@ibiz-template/runtime 0.1.29-dev.0 → 0.1.29
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 +795 -618
- 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/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/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/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/index.d.ts +1 -0
- package/out/interface/common/index.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/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/controller/common/control/md-control.controller.ts +2 -1
- package/src/controller/control/dashboard/dashboard.controller.ts +2 -6
- 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/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/index.ts +1 -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/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
|
@@ -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";
|
|
@@ -11425,7 +11183,7 @@ var AppDataEntity = class _AppDataEntity {
|
|
|
11425
11183
|
};
|
|
11426
11184
|
|
|
11427
11185
|
// src/service/dto/method.dto.ts
|
|
11428
|
-
import { ModelError as
|
|
11186
|
+
import { ModelError as ModelError5 } from "@ibiz-template/core";
|
|
11429
11187
|
var MethodDto = class _MethodDto {
|
|
11430
11188
|
constructor(entity, isLocalMode2, dto) {
|
|
11431
11189
|
this.entity = entity;
|
|
@@ -11479,7 +11237,7 @@ var MethodDto = class _MethodDto {
|
|
|
11479
11237
|
break;
|
|
11480
11238
|
}
|
|
11481
11239
|
default:
|
|
11482
|
-
throw new
|
|
11240
|
+
throw new ModelError5(
|
|
11483
11241
|
field,
|
|
11484
11242
|
"\u672A\u652F\u6301\u7684\u5E94\u7528\u5B9E\u4F53\u65B9\u6CD5\u8F93\u5165\u5C5E\u6027\u7C7B\u578B: ".concat(field.type)
|
|
11485
11243
|
);
|
|
@@ -11686,7 +11444,7 @@ var Method = class {
|
|
|
11686
11444
|
case "POST":
|
|
11687
11445
|
res = await this.app.net.post(
|
|
11688
11446
|
"".concat(path2, "/").concat(methodName),
|
|
11689
|
-
|
|
11447
|
+
notNilEmpty6(data) ? data : params
|
|
11690
11448
|
);
|
|
11691
11449
|
break;
|
|
11692
11450
|
case "GET":
|
|
@@ -11695,7 +11453,7 @@ var Method = class {
|
|
|
11695
11453
|
case "PUT": {
|
|
11696
11454
|
res = await this.app.net.put(
|
|
11697
11455
|
"".concat(path2, "/").concat(methodName),
|
|
11698
|
-
|
|
11456
|
+
notNilEmpty6(data) ? data : params
|
|
11699
11457
|
);
|
|
11700
11458
|
break;
|
|
11701
11459
|
}
|
|
@@ -11765,10 +11523,10 @@ var Method = class {
|
|
|
11765
11523
|
};
|
|
11766
11524
|
|
|
11767
11525
|
// src/de-logic/index.ts
|
|
11768
|
-
import { HttpError as HttpError2, HttpResponse as HttpResponse2, RuntimeError as
|
|
11526
|
+
import { HttpError as HttpError2, HttpResponse as HttpResponse2, RuntimeError as RuntimeError11 } from "@ibiz-template/core";
|
|
11769
11527
|
|
|
11770
11528
|
// src/de-logic/de-logic.ts
|
|
11771
|
-
import { ModelError as
|
|
11529
|
+
import { ModelError as ModelError11, RuntimeModelError as RuntimeModelError17 } from "@ibiz-template/core";
|
|
11772
11530
|
|
|
11773
11531
|
// src/de-logic/de-logic-context.ts
|
|
11774
11532
|
var DELogicContext = class {
|
|
@@ -11887,7 +11645,7 @@ var DELogicLinkCond = class {
|
|
|
11887
11645
|
};
|
|
11888
11646
|
|
|
11889
11647
|
// src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts
|
|
11890
|
-
import { ModelError as
|
|
11648
|
+
import { ModelError as ModelError6, RuntimeModelError as RuntimeModelError8 } from "@ibiz-template/core";
|
|
11891
11649
|
var DELogicLinkSingleCond = class extends DELogicLinkCond {
|
|
11892
11650
|
constructor(model) {
|
|
11893
11651
|
super();
|
|
@@ -11953,7 +11711,7 @@ var DELogicLinkSingleCond = class extends DELogicLinkCond {
|
|
|
11953
11711
|
return testCond(dst[this.dstField], this.op, src[this.value]);
|
|
11954
11712
|
}
|
|
11955
11713
|
case "CURTIME":
|
|
11956
|
-
throw new
|
|
11714
|
+
throw new ModelError6(this.model, "\u6682\u672A\u652F\u6301\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u5F53\u524D\u65F6\u95F4]");
|
|
11957
11715
|
default:
|
|
11958
11716
|
return testCond(dst[this.dstField], this.op, this.value);
|
|
11959
11717
|
}
|
|
@@ -12137,7 +11895,7 @@ var StartNode = class extends DELogicNode {
|
|
|
12137
11895
|
};
|
|
12138
11896
|
|
|
12139
11897
|
// src/de-logic/de-logic-node/end-node/end-node.ts
|
|
12140
|
-
import { ModelError as
|
|
11898
|
+
import { ModelError as ModelError7 } from "@ibiz-template/core";
|
|
12141
11899
|
var EndNode = class extends DELogicNode {
|
|
12142
11900
|
async exec(ctx) {
|
|
12143
11901
|
ctx.isEndNode = true;
|
|
@@ -12161,7 +11919,7 @@ var EndNode = class extends DELogicNode {
|
|
|
12161
11919
|
case "LOGICPARAMFIELD":
|
|
12162
11920
|
case "BREAK":
|
|
12163
11921
|
default:
|
|
12164
|
-
throw new
|
|
11922
|
+
throw new ModelError7(
|
|
12165
11923
|
this.model,
|
|
12166
11924
|
"\u6682\u672A\u652F\u6301\u7684\u7ED3\u675F\u8282\u70B9\u8FD4\u56DE\u503C\u7C7B\u578B: ".concat(returnType)
|
|
12167
11925
|
);
|
|
@@ -12170,11 +11928,11 @@ var EndNode = class extends DELogicNode {
|
|
|
12170
11928
|
};
|
|
12171
11929
|
|
|
12172
11930
|
// src/de-logic/de-logic-node/prepare-param-node/prepare-param-node.ts
|
|
12173
|
-
import { ModelError as
|
|
11931
|
+
import { ModelError as ModelError9 } from "@ibiz-template/core";
|
|
12174
11932
|
import { clone as clone6 } from "ramda";
|
|
12175
11933
|
|
|
12176
11934
|
// src/de-logic/utils/handle-src-val.ts
|
|
12177
|
-
import { ModelError as
|
|
11935
|
+
import { ModelError as ModelError8 } from "@ibiz-template/core";
|
|
12178
11936
|
import { clone as clone5 } from "ramda";
|
|
12179
11937
|
function handleSrcVal(ctx, srcValParams) {
|
|
12180
11938
|
const { srcDELogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
@@ -12208,7 +11966,7 @@ function handleSrcVal(ctx, srcValParams) {
|
|
|
12208
11966
|
value = clone5(ibiz.env);
|
|
12209
11967
|
break;
|
|
12210
11968
|
default:
|
|
12211
|
-
throw new
|
|
11969
|
+
throw new ModelError8(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
12212
11970
|
}
|
|
12213
11971
|
if (value && srcField) {
|
|
12214
11972
|
try {
|
|
@@ -12251,7 +12009,7 @@ var PrepareParamNode = class extends DELogicNode {
|
|
|
12251
12009
|
case "SORTPARAM":
|
|
12252
12010
|
return this.sortParam(nodeParam, ctx);
|
|
12253
12011
|
default:
|
|
12254
|
-
throw new
|
|
12012
|
+
throw new ModelError9(
|
|
12255
12013
|
nodeParam,
|
|
12256
12014
|
"\u6682\u672A\u652F\u6301\u903B\u8F91\u5904\u7406\u53C2\u6570\u64CD\u4F5C".concat(nodeParam.paramAction)
|
|
12257
12015
|
);
|
|
@@ -12511,7 +12269,7 @@ var ThrowExceptionNode = class extends DELogicNode {
|
|
|
12511
12269
|
};
|
|
12512
12270
|
|
|
12513
12271
|
// src/de-logic/de-logic-param/de-logic-param.ts
|
|
12514
|
-
import { ModelError as
|
|
12272
|
+
import { ModelError as ModelError10 } from "@ibiz-template/core";
|
|
12515
12273
|
import { clone as clone8 } from "ramda";
|
|
12516
12274
|
var DELogicParam = class {
|
|
12517
12275
|
/**
|
|
@@ -12544,7 +12302,7 @@ var DELogicParam = class {
|
|
|
12544
12302
|
} else if (m.entityListParam) {
|
|
12545
12303
|
ctx.params[tag] = [];
|
|
12546
12304
|
} else if (m.entityPageParam) {
|
|
12547
|
-
throw new
|
|
12305
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u5206\u9875\u67E5\u8BE2\u7ED3\u679C");
|
|
12548
12306
|
} else if (m.entityParam) {
|
|
12549
12307
|
ctx.params[tag] = {};
|
|
12550
12308
|
} else if (m.lastReturnParam) {
|
|
@@ -12558,19 +12316,19 @@ var DELogicParam = class {
|
|
|
12558
12316
|
} else if (m.cloneParam) {
|
|
12559
12317
|
ctx.params[tag] = clone8(ctx.data || {});
|
|
12560
12318
|
} else if (m.envParam) {
|
|
12561
|
-
throw new
|
|
12319
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u7CFB\u7EDF\u73AF\u5883\u53D8\u91CF");
|
|
12562
12320
|
} else if (m.fileListParam) {
|
|
12563
|
-
throw new
|
|
12321
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6587\u4EF6\u5BF9\u8C61\u5217\u8868\u53D8\u91CF");
|
|
12564
12322
|
} else if (m.fileParam) {
|
|
12565
|
-
throw new
|
|
12323
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6587\u4EF6\u5BF9\u8C61\u53D8\u91CF");
|
|
12566
12324
|
} else if (m.filterParam) {
|
|
12567
|
-
throw new
|
|
12325
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u8FC7\u6EE4\u5668\u5BF9\u8C61\u53D8\u91CF");
|
|
12568
12326
|
} else if (m.lastParam) {
|
|
12569
|
-
throw new
|
|
12327
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u6700\u540E\u6570\u636E\u53D8\u91CF");
|
|
12570
12328
|
} else if (m.originEntity) {
|
|
12571
|
-
throw new
|
|
12329
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u539F\u59CB\u6570\u636E\u5BF9\u8C61");
|
|
12572
12330
|
} else if (m.sessionParam) {
|
|
12573
|
-
throw new
|
|
12331
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u64CD\u4F5C\u4F1A\u8BDD\u53D8\u91CF");
|
|
12574
12332
|
}
|
|
12575
12333
|
}
|
|
12576
12334
|
/**
|
|
@@ -12587,7 +12345,7 @@ var DELogicParam = class {
|
|
|
12587
12345
|
} else if (m.simpleParam || m.entityParam) {
|
|
12588
12346
|
ctx.params[tag] = {};
|
|
12589
12347
|
} else {
|
|
12590
|
-
throw new
|
|
12348
|
+
throw new ModelError10(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B\u91CD\u65B0\u5EFA\u7ACB\u53D8\u91CF");
|
|
12591
12349
|
}
|
|
12592
12350
|
}
|
|
12593
12351
|
};
|
|
@@ -12674,7 +12432,7 @@ var DELogic = class {
|
|
|
12674
12432
|
logicNode = new SortParamNode(node);
|
|
12675
12433
|
break;
|
|
12676
12434
|
default:
|
|
12677
|
-
throw new
|
|
12435
|
+
throw new ModelError11(node, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8282\u70B9\u7C7B\u578B: ".concat(logicNodeType));
|
|
12678
12436
|
}
|
|
12679
12437
|
this.nodes.set(node.id, logicNode);
|
|
12680
12438
|
});
|
|
@@ -12786,7 +12544,7 @@ async function execDELogicById(deDELogicId, dataEntityId, context, data, params)
|
|
|
12786
12544
|
context.srfappid
|
|
12787
12545
|
);
|
|
12788
12546
|
if (!deLogic) {
|
|
12789
|
-
throw new
|
|
12547
|
+
throw new RuntimeError11("".concat(dataEntityId, "\u627E\u4E0D\u5230\u5B9E\u4F53\u903B\u8F91").concat(deDELogicId));
|
|
12790
12548
|
}
|
|
12791
12549
|
return execDELogic(deLogic, context, data, params);
|
|
12792
12550
|
}
|
|
@@ -13122,7 +12880,7 @@ var DEActionMethod = class extends Method {
|
|
|
13122
12880
|
// src/service/service/entity/method/fetch.ts
|
|
13123
12881
|
import {
|
|
13124
12882
|
HttpResponse as HttpResponse4,
|
|
13125
|
-
ModelError as
|
|
12883
|
+
ModelError as ModelError12,
|
|
13126
12884
|
RuntimeModelError as RuntimeModelError19
|
|
13127
12885
|
} from "@ibiz-template/core";
|
|
13128
12886
|
import { ascSort, descSort } from "qx-util";
|
|
@@ -13153,7 +12911,7 @@ var FetchMethod = class extends Method {
|
|
|
13153
12911
|
}
|
|
13154
12912
|
break;
|
|
13155
12913
|
default:
|
|
13156
|
-
throw new
|
|
12914
|
+
throw new ModelError12(
|
|
13157
12915
|
this.method,
|
|
13158
12916
|
"\u6570\u636E\u6765\u6E90\u7C7B\u578B".concat(this.method.dataSetType, "\u6682\u672A\u652F\u6301")
|
|
13159
12917
|
);
|
|
@@ -13356,7 +13114,7 @@ var DEService = class {
|
|
|
13356
13114
|
method = new FetchMethod(this.model, model);
|
|
13357
13115
|
break;
|
|
13358
13116
|
default:
|
|
13359
|
-
throw new
|
|
13117
|
+
throw new ModelError13(
|
|
13360
13118
|
model,
|
|
13361
13119
|
"\u672A\u652F\u6301\u7684\u670D\u52A1\u65B9\u6CD5\u7C7B\u578B: ".concat(model.methodType)
|
|
13362
13120
|
);
|
|
@@ -13380,7 +13138,7 @@ var DEService = class {
|
|
|
13380
13138
|
if (method) {
|
|
13381
13139
|
return method.exec(context, params, params2);
|
|
13382
13140
|
}
|
|
13383
|
-
throw new
|
|
13141
|
+
throw new RuntimeError12("".concat(this.model.codeName, "\u672A\u652F\u6301\u300C").concat(id, "\u300D\u65B9\u6CD5"));
|
|
13384
13142
|
}
|
|
13385
13143
|
};
|
|
13386
13144
|
|
|
@@ -13646,7 +13404,7 @@ var ControlService = class {
|
|
|
13646
13404
|
};
|
|
13647
13405
|
|
|
13648
13406
|
// src/service/service/control/md-control.service.ts
|
|
13649
|
-
import { RuntimeError as
|
|
13407
|
+
import { RuntimeError as RuntimeError13 } from "@ibiz-template/core";
|
|
13650
13408
|
import { isArray as isArray3 } from "qx-util";
|
|
13651
13409
|
var MDControlService = class extends ControlService {
|
|
13652
13410
|
/**
|
|
@@ -13755,7 +13513,7 @@ var MDControlService = class extends ControlService {
|
|
|
13755
13513
|
* @returns {*} {Promise<IHttpResponse>}
|
|
13756
13514
|
*/
|
|
13757
13515
|
async exportData(_dataExport, _context, _params = {}) {
|
|
13758
|
-
throw new
|
|
13516
|
+
throw new RuntimeError13("\u672A\u5B9E\u73B0");
|
|
13759
13517
|
}
|
|
13760
13518
|
/**
|
|
13761
13519
|
* 处理响应
|
|
@@ -13790,7 +13548,7 @@ var MDControlService = class extends ControlService {
|
|
|
13790
13548
|
};
|
|
13791
13549
|
|
|
13792
13550
|
// src/service/service/authority/authority.service.ts
|
|
13793
|
-
import { RuntimeError as
|
|
13551
|
+
import { RuntimeError as RuntimeError14 } from "@ibiz-template/core";
|
|
13794
13552
|
|
|
13795
13553
|
// src/service/service/authority/de-authority.service.ts
|
|
13796
13554
|
var DeAuthorityService = class {
|
|
@@ -13926,7 +13684,7 @@ var AuthorityService = class {
|
|
|
13926
13684
|
this.appModel.appId
|
|
13927
13685
|
);
|
|
13928
13686
|
if (!entityModel) {
|
|
13929
|
-
throw new
|
|
13687
|
+
throw new RuntimeError14("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
13930
13688
|
}
|
|
13931
13689
|
const constructor = this.constructorCache.get(id);
|
|
13932
13690
|
let service;
|
|
@@ -14311,103 +14069,383 @@ var CalendarItemData = class {
|
|
|
14311
14069
|
};
|
|
14312
14070
|
|
|
14313
14071
|
// src/service/de-service-util.ts
|
|
14314
|
-
import { RuntimeError as
|
|
14072
|
+
import { RuntimeError as RuntimeError15 } from "@ibiz-template/core";
|
|
14315
14073
|
var DEServiceUtil = class {
|
|
14316
14074
|
/**
|
|
14317
|
-
* Creates an instance of DEServiceUtil.
|
|
14075
|
+
* Creates an instance of DEServiceUtil.
|
|
14076
|
+
*
|
|
14077
|
+
* @author chitanda
|
|
14078
|
+
* @date 2023-04-18 14:04:01
|
|
14079
|
+
* @param {IApplication} appModel
|
|
14080
|
+
*/
|
|
14081
|
+
constructor(appModel) {
|
|
14082
|
+
this.appModel = appModel;
|
|
14083
|
+
/**
|
|
14084
|
+
* 实体服务缓存
|
|
14085
|
+
*
|
|
14086
|
+
* @author chitanda
|
|
14087
|
+
* @date 2022-08-17 23:08:36
|
|
14088
|
+
* @protected
|
|
14089
|
+
* @type {Map<string, IAppDEService>}
|
|
14090
|
+
*/
|
|
14091
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
14092
|
+
/**
|
|
14093
|
+
* 实体服务构造方法缓存
|
|
14094
|
+
* @author lxm
|
|
14095
|
+
* @date 2023-05-15 08:37:13
|
|
14096
|
+
* @protected
|
|
14097
|
+
*/
|
|
14098
|
+
this.constructorCache = /* @__PURE__ */ new Map();
|
|
14099
|
+
}
|
|
14100
|
+
/**
|
|
14101
|
+
* 注册服务工厂方法
|
|
14102
|
+
*
|
|
14103
|
+
* @author chitanda
|
|
14104
|
+
* @date 2023-06-14 10:06:31
|
|
14105
|
+
* @param {string} id
|
|
14106
|
+
* @param {(entityModel: IAppDataEntity) => Promise<IAppDEService>} constructor
|
|
14107
|
+
*/
|
|
14108
|
+
register(id, constructor) {
|
|
14109
|
+
this.constructorCache.set(id, constructor);
|
|
14110
|
+
}
|
|
14111
|
+
/**
|
|
14112
|
+
* 根据实体标识获取实体服务
|
|
14113
|
+
*
|
|
14114
|
+
* @author chitanda
|
|
14115
|
+
* @date 2022-12-23 10:12:24
|
|
14116
|
+
* @param {string} id 实体标识
|
|
14117
|
+
* @param {IParams} [context] 上下文,用于计算模型所属沙箱环境
|
|
14118
|
+
* @return {*} {Promise<IAppDEService>}
|
|
14119
|
+
*/
|
|
14120
|
+
async getService(id) {
|
|
14121
|
+
if (!this.cache.has(id)) {
|
|
14122
|
+
const entityModel = await ibiz.hub.getAppDataEntity(
|
|
14123
|
+
id,
|
|
14124
|
+
this.appModel.appId
|
|
14125
|
+
);
|
|
14126
|
+
if (!entityModel) {
|
|
14127
|
+
throw new RuntimeError15("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
|
|
14128
|
+
}
|
|
14129
|
+
const constructor = this.constructorCache.get(id);
|
|
14130
|
+
let service;
|
|
14131
|
+
if (constructor) {
|
|
14132
|
+
service = await constructor(entityModel);
|
|
14133
|
+
} else {
|
|
14134
|
+
service = new DEService(entityModel);
|
|
14135
|
+
}
|
|
14136
|
+
this.cache.set(id, service);
|
|
14137
|
+
}
|
|
14138
|
+
return this.cache.get(id);
|
|
14139
|
+
}
|
|
14140
|
+
/**
|
|
14141
|
+
* 清理所有服务, 当前临时域下的所有临时数据缓存
|
|
14142
|
+
*
|
|
14143
|
+
* @description 根据 srfsessionid 作为临时数据域
|
|
14144
|
+
* @author chitanda
|
|
14145
|
+
* @date 2022-08-18 14:08:48
|
|
14146
|
+
* @param {IParams} context
|
|
14147
|
+
*/
|
|
14148
|
+
clearTempCache(context) {
|
|
14149
|
+
this.cache.forEach((service) => {
|
|
14150
|
+
service.local.clear(context);
|
|
14151
|
+
});
|
|
14152
|
+
}
|
|
14153
|
+
/**
|
|
14154
|
+
* 执行服务方法
|
|
14155
|
+
* @author lxm
|
|
14156
|
+
* @date 2023-04-26 02:02:43
|
|
14157
|
+
* @param {string} appDataEntityId 实体名称
|
|
14158
|
+
* @param {string} methodName 方法名
|
|
14159
|
+
* @param {IParams} context 上下文
|
|
14160
|
+
* @param {(IData | undefined)} [params] 数据
|
|
14161
|
+
* @param {(IParams | undefined)} [params2] 视图参数
|
|
14162
|
+
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
14163
|
+
*/
|
|
14164
|
+
async exec(appDataEntityId, methodName, context, params, params2) {
|
|
14165
|
+
const service = await this.getService(appDataEntityId);
|
|
14166
|
+
return service.exec(methodName, context, params, params2);
|
|
14167
|
+
}
|
|
14168
|
+
};
|
|
14169
|
+
|
|
14170
|
+
// src/command/app/open-app-view/open-app-view.ts
|
|
14171
|
+
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
14172
|
+
constructor() {
|
|
14173
|
+
ibiz.commands.register(_OpenAppViewCommand.TAG, this.exec.bind(this));
|
|
14174
|
+
}
|
|
14175
|
+
/**
|
|
14176
|
+
* xhr模式打开
|
|
14177
|
+
*
|
|
14178
|
+
* @author chitanda
|
|
14179
|
+
* @date 2022-08-25 23:08:08
|
|
14180
|
+
* @param {string} appViewId
|
|
14181
|
+
* @param {IContext} [context]
|
|
14182
|
+
* @param {IParams} [params={}]
|
|
14183
|
+
* @param {IData} [_opts={}]
|
|
14184
|
+
* @return {*} {(Promise<IModalData | void>)}
|
|
14185
|
+
*/
|
|
14186
|
+
async exec(appViewId, _context, params = {}, opts = {}) {
|
|
14187
|
+
const context = clone11(_context);
|
|
14188
|
+
const appView = await ibiz.hub.config.view.get(appViewId);
|
|
14189
|
+
if (!appView) {
|
|
14190
|
+
throw new RuntimeError16("\u5E94\u7528\u89C6\u56FE[".concat(appViewId, "]\u4E0D\u5B58\u5728"));
|
|
14191
|
+
}
|
|
14192
|
+
if ((context.srfkey || params.srfuf === 0 /* CREATE */) && appView.appDataEntityId) {
|
|
14193
|
+
const deName = calcDeCodeNameById(appView.appDataEntityId);
|
|
14194
|
+
if (context.srfkey) {
|
|
14195
|
+
context[deName] = context.srfkey;
|
|
14196
|
+
context.srfkey = void 0;
|
|
14197
|
+
}
|
|
14198
|
+
if (params.srfuf === 0 /* CREATE */) {
|
|
14199
|
+
context[deName] = void 0;
|
|
14200
|
+
delete params.srfuf;
|
|
14201
|
+
}
|
|
14202
|
+
}
|
|
14203
|
+
if (appView.redirectView) {
|
|
14204
|
+
const fullViewModel = await ibiz.hub.getAppView(appViewId);
|
|
14205
|
+
return openRedirectView(
|
|
14206
|
+
fullViewModel,
|
|
14207
|
+
context,
|
|
14208
|
+
params,
|
|
14209
|
+
opts
|
|
14210
|
+
);
|
|
14211
|
+
}
|
|
14212
|
+
const { openMode = "INDEXVIEWTAB" } = appView;
|
|
14213
|
+
switch (opts.openMode || openMode) {
|
|
14214
|
+
case "INDEXVIEWTAB":
|
|
14215
|
+
if (opts.noWaitRoute) {
|
|
14216
|
+
this.openIndexViewTab(appView, context, params);
|
|
14217
|
+
return { ok: true };
|
|
14218
|
+
}
|
|
14219
|
+
return this.openIndexViewTab(appView, context, params);
|
|
14220
|
+
case "POPUP":
|
|
14221
|
+
throw new ModelError14(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUP");
|
|
14222
|
+
case "POPUPMODAL":
|
|
14223
|
+
return this.openModal(appView, context, params);
|
|
14224
|
+
case "POPUPAPP":
|
|
14225
|
+
throw new ModelError14(appView, "\u672A\u652F\u6301\u7684\u89C6\u56FE\u6253\u5F00\u6A21\u5F0F: POPUPAPP");
|
|
14226
|
+
case "POPOVER":
|
|
14227
|
+
return this.openPopover(appView, opts.event, context, params);
|
|
14228
|
+
case "DRAWER_LEFT":
|
|
14229
|
+
case "DRAWER_RIGHT":
|
|
14230
|
+
case "DRAWER_TOP":
|
|
14231
|
+
case "DRAWER_BOTTOM":
|
|
14232
|
+
return this.openDrawer(appView, context, params);
|
|
14233
|
+
case "USER":
|
|
14234
|
+
return this.openUserCustom(appView, context, params);
|
|
14235
|
+
default:
|
|
14236
|
+
return this.openIndexViewTab(appView, context, params);
|
|
14237
|
+
}
|
|
14238
|
+
}
|
|
14239
|
+
/**
|
|
14240
|
+
* 首页导航模式打开
|
|
14241
|
+
*
|
|
14242
|
+
* @author chitanda
|
|
14243
|
+
* @date 2022-07-25 20:07:43
|
|
14244
|
+
* @protected
|
|
14245
|
+
* @param {IViewConfig} appView
|
|
14246
|
+
* @param {IContext} [context]
|
|
14247
|
+
* @param {IParams} [params={}]
|
|
14248
|
+
*/
|
|
14249
|
+
openIndexViewTab(appView, context, params = {}) {
|
|
14250
|
+
return ibiz.openView.root(appView.id, context, params);
|
|
14251
|
+
}
|
|
14252
|
+
/**
|
|
14253
|
+
* 模态窗口打开
|
|
14254
|
+
*
|
|
14255
|
+
* @author chitanda
|
|
14256
|
+
* @date 2022-07-25 20:07:55
|
|
14257
|
+
* @protected
|
|
14258
|
+
* @param {IViewConfig} appView
|
|
14259
|
+
* @param {IContext} [context]
|
|
14260
|
+
* @param {IParams} [params={}]
|
|
14261
|
+
* @return {*} {Promise<IModalData>}
|
|
14262
|
+
*/
|
|
14263
|
+
async openModal(appView, context, params = {}) {
|
|
14264
|
+
return ibiz.openView.modal(appView.id, context, params);
|
|
14265
|
+
}
|
|
14266
|
+
/**
|
|
14267
|
+
* 气泡模式打开
|
|
14268
|
+
*
|
|
14269
|
+
* @author chitanda
|
|
14270
|
+
* @date 2022-07-25 20:07:17
|
|
14271
|
+
* @protected
|
|
14272
|
+
* @param {IViewConfig} appView
|
|
14273
|
+
* @param {IContext} [context]
|
|
14274
|
+
* @param {IParams} [params={}]
|
|
14275
|
+
* @return {*} {Promise<IModalData>}
|
|
14276
|
+
*/
|
|
14277
|
+
async openPopover(appView, event, context, params = {}) {
|
|
14278
|
+
if (!event) {
|
|
14279
|
+
throw new RuntimeError16("\u6C14\u6CE1\u6253\u5F00\u7F3A\u5C11event");
|
|
14280
|
+
}
|
|
14281
|
+
return ibiz.openView.popover(appView.id, event, context, params);
|
|
14282
|
+
}
|
|
14283
|
+
/**
|
|
14284
|
+
* 抽屉模式打开
|
|
14285
|
+
*
|
|
14286
|
+
* @author chitanda
|
|
14287
|
+
* @date 2022-07-25 20:07:08
|
|
14288
|
+
* @protected
|
|
14289
|
+
* @param {IViewConfig} appView
|
|
14290
|
+
* @param {IContext} [context]
|
|
14291
|
+
* @param {IParams} [params={}]
|
|
14292
|
+
* @return {*} {Promise<void>}
|
|
14293
|
+
*/
|
|
14294
|
+
async openDrawer(appView, context, params = {}) {
|
|
14295
|
+
return ibiz.openView.drawer(appView.id, context, params);
|
|
14296
|
+
}
|
|
14297
|
+
/**
|
|
14298
|
+
* 用户自定义
|
|
14299
|
+
*
|
|
14300
|
+
* @author chitanda
|
|
14301
|
+
* @date 2022-07-25 20:07:41
|
|
14302
|
+
* @protected
|
|
14303
|
+
* @param {IViewConfig} appView
|
|
14304
|
+
* @param {IContext} [context]
|
|
14305
|
+
* @param {IParams} [params={}]
|
|
14306
|
+
* @return {*} {Promise<void>}
|
|
14307
|
+
*/
|
|
14308
|
+
async openUserCustom(appView, context, params = {}) {
|
|
14309
|
+
return ibiz.openView.custom(appView.id, context, params);
|
|
14310
|
+
}
|
|
14311
|
+
};
|
|
14312
|
+
_OpenAppViewCommand.TAG = "ibiz.app-view.open";
|
|
14313
|
+
var OpenAppViewCommand = _OpenAppViewCommand;
|
|
14314
|
+
|
|
14315
|
+
// src/command/app/app-func/app-func.ts
|
|
14316
|
+
var _AppFuncCommand = class _AppFuncCommand {
|
|
14317
|
+
constructor() {
|
|
14318
|
+
ibiz.commands.register(_AppFuncCommand.TAG, this.exec.bind(this));
|
|
14319
|
+
}
|
|
14320
|
+
/**
|
|
14321
|
+
* 执行应用功能
|
|
14322
|
+
*
|
|
14323
|
+
* @author chitanda
|
|
14324
|
+
* @date 2022-07-25 17:07:35
|
|
14325
|
+
* @param {IAppFunc} appFunc 应用功能模型
|
|
14326
|
+
* @param {IContext} [context] 执行上下文
|
|
14327
|
+
* @param {IParams} [params={}] 参数
|
|
14328
|
+
* @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
|
|
14329
|
+
* @return {*} {Promise<void>}
|
|
14330
|
+
*/
|
|
14331
|
+
async exec(appFuncId, context, params = {}, opts = {}) {
|
|
14332
|
+
const appFunc = ibiz.hub.getApp(context.srfappid).getAppFunc(appFuncId);
|
|
14333
|
+
if (!appFunc) {
|
|
14334
|
+
throw new RuntimeError17("\u627E\u4E0D\u5230\u53EB".concat(appFuncId, "\u7684\u5E94\u7528\u529F\u80FD"));
|
|
14335
|
+
}
|
|
14336
|
+
const { navigateContexts, navigateParams, appFuncType } = appFunc;
|
|
14337
|
+
const _context = context.clone();
|
|
14338
|
+
Object.assign(_context, convertNavData(navigateContexts, params, context));
|
|
14339
|
+
const _params = convertNavData(navigateParams, params, context);
|
|
14340
|
+
switch (appFuncType) {
|
|
14341
|
+
case "APPVIEW":
|
|
14342
|
+
return this.openAppView(appFunc, _context, _params, opts);
|
|
14343
|
+
case "OPENHTMLPAGE":
|
|
14344
|
+
return this.openHtmlPage(appFunc);
|
|
14345
|
+
case "PDTAPPFUNC":
|
|
14346
|
+
return this.openPdAppFunc(appFunc, _context, _params);
|
|
14347
|
+
case "JAVASCRIPT":
|
|
14348
|
+
return this.executeJavaScript(appFunc, _context, _params);
|
|
14349
|
+
case "CUSTOM":
|
|
14350
|
+
return this.custom(appFunc, _context, _params);
|
|
14351
|
+
default:
|
|
14352
|
+
throw new ModelError15(appFunc, "\u672A\u652F\u6301\u7684\u5E94\u7528\u529F\u80FD\u7C7B\u578B: ".concat(appFuncType));
|
|
14353
|
+
}
|
|
14354
|
+
}
|
|
14355
|
+
/**
|
|
14356
|
+
* 打开应用视图
|
|
14318
14357
|
*
|
|
14319
14358
|
* @author chitanda
|
|
14320
|
-
* @date
|
|
14321
|
-
* @
|
|
14359
|
+
* @date 2022-07-25 18:07:49
|
|
14360
|
+
* @protected
|
|
14361
|
+
* @param {IAppFunc} appFunc
|
|
14362
|
+
* @param {IContext} [context]
|
|
14363
|
+
* @param {IParams} [params]
|
|
14364
|
+
* @return {*} {Promise<void>}
|
|
14322
14365
|
*/
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
/**
|
|
14335
|
-
* 实体服务构造方法缓存
|
|
14336
|
-
* @author lxm
|
|
14337
|
-
* @date 2023-05-15 08:37:13
|
|
14338
|
-
* @protected
|
|
14339
|
-
*/
|
|
14340
|
-
this.constructorCache = /* @__PURE__ */ new Map();
|
|
14366
|
+
async openAppView(appFunc, context, params, opts) {
|
|
14367
|
+
if (!appFunc.appViewId) {
|
|
14368
|
+
throw new RuntimeError17("\u5E94\u7528\u89C6\u56FE[".concat(appFunc.appViewId, "]\u4E0D\u5B58\u5728"));
|
|
14369
|
+
}
|
|
14370
|
+
return ibiz.commands.execute(
|
|
14371
|
+
OpenAppViewCommand.TAG,
|
|
14372
|
+
appFunc.appViewId,
|
|
14373
|
+
context,
|
|
14374
|
+
params,
|
|
14375
|
+
opts
|
|
14376
|
+
);
|
|
14341
14377
|
}
|
|
14342
14378
|
/**
|
|
14343
|
-
*
|
|
14379
|
+
* 打开HTML页面
|
|
14344
14380
|
*
|
|
14345
14381
|
* @author chitanda
|
|
14346
|
-
* @date
|
|
14347
|
-
* @
|
|
14348
|
-
* @param {
|
|
14382
|
+
* @date 2022-07-25 18:07:56
|
|
14383
|
+
* @protected
|
|
14384
|
+
* @param {IAppFunc} appFunc
|
|
14349
14385
|
*/
|
|
14350
|
-
|
|
14351
|
-
|
|
14386
|
+
openHtmlPage(appFunc) {
|
|
14387
|
+
const url = appFunc.htmlPageUrl;
|
|
14388
|
+
window.open(url, "_blank");
|
|
14352
14389
|
}
|
|
14353
14390
|
/**
|
|
14354
|
-
*
|
|
14391
|
+
* 应用预置功能
|
|
14355
14392
|
*
|
|
14356
14393
|
* @author chitanda
|
|
14357
|
-
* @date 2022-
|
|
14358
|
-
* @
|
|
14359
|
-
* @param {
|
|
14360
|
-
* @
|
|
14394
|
+
* @date 2022-07-25 18:07:22
|
|
14395
|
+
* @protected
|
|
14396
|
+
* @param {IAppFunc} appFunc
|
|
14397
|
+
* @param {IContext} [context]
|
|
14398
|
+
* @param {IParams} [params]
|
|
14361
14399
|
*/
|
|
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);
|
|
14400
|
+
openPdAppFunc(appFunc, context, params) {
|
|
14401
|
+
ibiz.log.warn("openPdAppFunc", appFunc, context, params);
|
|
14402
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14381
14403
|
}
|
|
14382
14404
|
/**
|
|
14383
|
-
*
|
|
14405
|
+
* 执行 JavaScript 脚本
|
|
14384
14406
|
*
|
|
14385
|
-
* @description 根据 srfsessionid 作为临时数据域
|
|
14386
14407
|
* @author chitanda
|
|
14387
|
-
* @date 2022-
|
|
14388
|
-
* @
|
|
14408
|
+
* @date 2022-07-25 18:07:09
|
|
14409
|
+
* @protected
|
|
14410
|
+
* @param {IAppFunc} appFunc
|
|
14411
|
+
* @param {IContext} [context]
|
|
14412
|
+
* @param {IParams} [params]
|
|
14389
14413
|
*/
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
});
|
|
14414
|
+
executeJavaScript(appFunc, context, params) {
|
|
14415
|
+
ibiz.log.warn("executeJavaScript", appFunc, context, params);
|
|
14416
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14394
14417
|
}
|
|
14395
14418
|
/**
|
|
14396
|
-
*
|
|
14397
|
-
*
|
|
14398
|
-
* @
|
|
14399
|
-
* @
|
|
14400
|
-
* @
|
|
14401
|
-
* @param {
|
|
14402
|
-
* @param {
|
|
14403
|
-
* @param {
|
|
14404
|
-
* @return {*} {Promise<IHttpResponse<IData>>}
|
|
14419
|
+
* 自定义应用功能
|
|
14420
|
+
*
|
|
14421
|
+
* @author chitanda
|
|
14422
|
+
* @date 2022-07-25 18:07:51
|
|
14423
|
+
* @protected
|
|
14424
|
+
* @param {IAppFunc} appFunc
|
|
14425
|
+
* @param {IContext} [context]
|
|
14426
|
+
* @param {IParams} [params]
|
|
14405
14427
|
*/
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14428
|
+
custom(appFunc, context, params) {
|
|
14429
|
+
ibiz.log.warn("custom", appFunc, context, params);
|
|
14430
|
+
throw new RuntimeError17("\u672A\u5B9E\u73B0");
|
|
14409
14431
|
}
|
|
14410
14432
|
};
|
|
14433
|
+
/**
|
|
14434
|
+
* 指令标识
|
|
14435
|
+
*
|
|
14436
|
+
* @author chitanda
|
|
14437
|
+
* @date 2022-07-25 17:07:20
|
|
14438
|
+
* @see 具体实现 {@link AppFuncCommand.exec}
|
|
14439
|
+
* @static
|
|
14440
|
+
*/
|
|
14441
|
+
_AppFuncCommand.TAG = "ibiz.app-func.exec";
|
|
14442
|
+
var AppFuncCommand = _AppFuncCommand;
|
|
14443
|
+
|
|
14444
|
+
// src/command/index.ts
|
|
14445
|
+
function installCommand() {
|
|
14446
|
+
new AppFuncCommand();
|
|
14447
|
+
new OpenAppViewCommand();
|
|
14448
|
+
}
|
|
14411
14449
|
|
|
14412
14450
|
// src/app-hub.ts
|
|
14413
14451
|
import { RuntimeError as RuntimeError48 } from "@ibiz-template/core";
|
|
@@ -14657,9 +14695,9 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
|
|
|
14657
14695
|
})(PanelNotifyState || {});
|
|
14658
14696
|
|
|
14659
14697
|
// src/controller/common/view/view.controller.ts
|
|
14660
|
-
import { createUUID as createUUID3, notNilEmpty as
|
|
14698
|
+
import { createUUID as createUUID3, notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
14661
14699
|
import { IBizContext as IBizContext2, RuntimeError as RuntimeError24 } from "@ibiz-template/core";
|
|
14662
|
-
import { isEmpty as isEmpty8, isNil as isNil15, isNotNil as
|
|
14700
|
+
import { isEmpty as isEmpty8, isNil as isNil15, isNotNil as isNotNil2 } from "ramda";
|
|
14663
14701
|
|
|
14664
14702
|
// src/controller/utils/loading/loading.state.ts
|
|
14665
14703
|
import { NOOP } from "@ibiz-template/core";
|
|
@@ -15394,7 +15432,7 @@ var ValueExUtil = class {
|
|
|
15394
15432
|
import { RuntimeError as RuntimeError22, ModelError as ModelError16 } from "@ibiz-template/core";
|
|
15395
15433
|
import dayjs from "dayjs";
|
|
15396
15434
|
import { createUUID as createUUID2 } from "qx-util";
|
|
15397
|
-
import { isNil as isNil13, isNotNil
|
|
15435
|
+
import { isNil as isNil13, isNotNil } from "ramda";
|
|
15398
15436
|
function getDefaultValue(opts, origins) {
|
|
15399
15437
|
var _a;
|
|
15400
15438
|
const { name, valueType, defaultValue, valueFormat } = opts;
|
|
@@ -15406,7 +15444,7 @@ function getDefaultValue(opts, origins) {
|
|
|
15406
15444
|
return null;
|
|
15407
15445
|
}
|
|
15408
15446
|
const value = data[name];
|
|
15409
|
-
if (
|
|
15447
|
+
if (isNotNil(value)) {
|
|
15410
15448
|
return;
|
|
15411
15449
|
}
|
|
15412
15450
|
if (!valueType && defaultValue) {
|
|
@@ -15989,7 +16027,7 @@ var ViewController = class extends BaseController {
|
|
|
15989
16027
|
async onCreated() {
|
|
15990
16028
|
await super.onCreated();
|
|
15991
16029
|
this.modal.hooks.beforeDismiss.tapPromise(async (modalData) => {
|
|
15992
|
-
if (
|
|
16030
|
+
if (isNotNil2(this.state.closeOK)) {
|
|
15993
16031
|
modalData.ok = this.state.closeOK;
|
|
15994
16032
|
}
|
|
15995
16033
|
await this._evt.emit("onCloseView", { ...modalData });
|
|
@@ -16065,13 +16103,13 @@ var ViewController = class extends BaseController {
|
|
|
16065
16103
|
}
|
|
16066
16104
|
const navContexts = this.model.appViewNavContexts;
|
|
16067
16105
|
let context = {};
|
|
16068
|
-
if (
|
|
16106
|
+
if (notNilEmpty7(navContexts)) {
|
|
16069
16107
|
context = convertNavData(navContexts, this.params, this.context);
|
|
16070
16108
|
}
|
|
16071
16109
|
Object.assign(this.context, context);
|
|
16072
16110
|
const navParams = this.model.appViewNavParams;
|
|
16073
16111
|
let params = {};
|
|
16074
|
-
if (
|
|
16112
|
+
if (notNilEmpty7(navParams)) {
|
|
16075
16113
|
params = convertNavData(navParams, this.params, this.context);
|
|
16076
16114
|
}
|
|
16077
16115
|
Object.assign(this.params, params);
|
|
@@ -16789,7 +16827,7 @@ var MDControlController = class extends ControlController {
|
|
|
16789
16827
|
let needRefresh = false;
|
|
16790
16828
|
try {
|
|
16791
16829
|
const deName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
16792
|
-
await
|
|
16830
|
+
await handleAllSettled(
|
|
16793
16831
|
data.map(async (item) => {
|
|
16794
16832
|
if (item.srfuf !== 0 /* CREATE */) {
|
|
16795
16833
|
const tempContext = context.clone();
|
|
@@ -17346,7 +17384,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
17346
17384
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
17347
17385
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
17348
17386
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
17349
|
-
import { clone as
|
|
17387
|
+
import { clone as clone12, isNil as isNil17, mergeDeepRight } from "ramda";
|
|
17350
17388
|
dayjs3.extend(minMax);
|
|
17351
17389
|
dayjs3.extend(isSameOrBefore);
|
|
17352
17390
|
dayjs3.extend(quarterOfYear);
|
|
@@ -17569,7 +17607,7 @@ var BaseSeriesGenerator = class {
|
|
|
17569
17607
|
dataPreprocess(data) {
|
|
17570
17608
|
const tempData = [];
|
|
17571
17609
|
data.forEach((singleData) => {
|
|
17572
|
-
tempData.push(
|
|
17610
|
+
tempData.push(clone12(singleData));
|
|
17573
17611
|
});
|
|
17574
17612
|
const { groupMode } = this.model;
|
|
17575
17613
|
if (groupMode) {
|
|
@@ -18909,11 +18947,11 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18909
18947
|
|
|
18910
18948
|
// src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
|
|
18911
18949
|
import { ModelError as ModelError21 } from "@ibiz-template/core";
|
|
18912
|
-
import { clone as
|
|
18950
|
+
import { clone as clone14 } from "ramda";
|
|
18913
18951
|
|
|
18914
18952
|
// src/ui-logic/utils/handle-src-val.ts
|
|
18915
18953
|
import { ModelError as ModelError20 } from "@ibiz-template/core";
|
|
18916
|
-
import { clone as
|
|
18954
|
+
import { clone as clone13 } from "ramda";
|
|
18917
18955
|
function handleSrcVal2(ctx, srcValParams) {
|
|
18918
18956
|
const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
18919
18957
|
const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
|
|
@@ -18943,7 +18981,7 @@ function handleSrcVal2(ctx, srcValParams) {
|
|
|
18943
18981
|
value = ctx.context;
|
|
18944
18982
|
break;
|
|
18945
18983
|
case "ENVPARAM":
|
|
18946
|
-
value =
|
|
18984
|
+
value = clone13(ibiz.env);
|
|
18947
18985
|
break;
|
|
18948
18986
|
default:
|
|
18949
18987
|
throw new ModelError20(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
@@ -19037,7 +19075,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
19037
19075
|
copyParam(nodeParam, ctx) {
|
|
19038
19076
|
const { dstDEUILogicParamId } = nodeParam;
|
|
19039
19077
|
const srcVal = handleSrcVal2(ctx, nodeParam);
|
|
19040
|
-
ctx.params[dstDEUILogicParamId] =
|
|
19078
|
+
ctx.params[dstDEUILogicParamId] = clone14(srcVal);
|
|
19041
19079
|
}
|
|
19042
19080
|
/**
|
|
19043
19081
|
* 绑定参数
|
|
@@ -19254,7 +19292,7 @@ var ResetParamNode2 = class extends UILogicNode {
|
|
|
19254
19292
|
|
|
19255
19293
|
// src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts
|
|
19256
19294
|
import { RuntimeModelError as RuntimeModelError37 } from "@ibiz-template/core";
|
|
19257
|
-
import { clone as
|
|
19295
|
+
import { clone as clone15 } from "ramda";
|
|
19258
19296
|
var CopyParamNode2 = class extends UILogicNode {
|
|
19259
19297
|
async exec(ctx) {
|
|
19260
19298
|
const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
|
|
@@ -19265,7 +19303,7 @@ var CopyParamNode2 = class extends UILogicNode {
|
|
|
19265
19303
|
);
|
|
19266
19304
|
}
|
|
19267
19305
|
const srcVal = handleSrcVal2(ctx, this.model);
|
|
19268
|
-
ctx.params[dstDEUILogicParamId] =
|
|
19306
|
+
ctx.params[dstDEUILogicParamId] = clone15(srcVal);
|
|
19269
19307
|
}
|
|
19270
19308
|
};
|
|
19271
19309
|
|
|
@@ -20288,7 +20326,7 @@ var ToolbarController = class extends ControlController {
|
|
|
20288
20326
|
},
|
|
20289
20327
|
{ childrenFields: ["detoolbarItems"] }
|
|
20290
20328
|
);
|
|
20291
|
-
await this.
|
|
20329
|
+
await this.calcButtonState();
|
|
20292
20330
|
}
|
|
20293
20331
|
/**
|
|
20294
20332
|
* 工具栏按钮点击事件
|
|
@@ -20318,23 +20356,29 @@ var ToolbarController = class extends ControlController {
|
|
|
20318
20356
|
_data = data.getOrigin();
|
|
20319
20357
|
}
|
|
20320
20358
|
await this.state.buttonsState.update(_data, appDeId);
|
|
20321
|
-
if (this.scheduler
|
|
20359
|
+
if (this.scheduler) {
|
|
20360
|
+
const logicParams = {};
|
|
20361
|
+
if (_data) {
|
|
20362
|
+
logicParams.data = [_data];
|
|
20363
|
+
}
|
|
20322
20364
|
recursiveIterate(
|
|
20323
20365
|
this.model,
|
|
20324
20366
|
(item) => {
|
|
20325
20367
|
const itemState = this.state.buttonsState[item.id];
|
|
20326
20368
|
if (itemState.visible) {
|
|
20327
|
-
const dynaVisible = this.scheduler.triggerItemVisible(
|
|
20328
|
-
|
|
20329
|
-
|
|
20369
|
+
const dynaVisible = this.scheduler.triggerItemVisible(
|
|
20370
|
+
item.id,
|
|
20371
|
+
logicParams
|
|
20372
|
+
);
|
|
20330
20373
|
if (dynaVisible !== void 0) {
|
|
20331
20374
|
itemState.visible = dynaVisible;
|
|
20332
20375
|
}
|
|
20333
20376
|
}
|
|
20334
20377
|
if (!itemState.disabled) {
|
|
20335
|
-
const dynaEnable = this.scheduler.triggerItemEnable(
|
|
20336
|
-
|
|
20337
|
-
|
|
20378
|
+
const dynaEnable = this.scheduler.triggerItemEnable(
|
|
20379
|
+
item.id,
|
|
20380
|
+
logicParams
|
|
20381
|
+
);
|
|
20338
20382
|
if (dynaEnable !== void 0) {
|
|
20339
20383
|
itemState.disabled = !dynaEnable;
|
|
20340
20384
|
}
|
|
@@ -20456,16 +20500,11 @@ var DashboardController = class extends ControlController {
|
|
|
20456
20500
|
* @param {string[]} names
|
|
20457
20501
|
*/
|
|
20458
20502
|
async dataChangeNotify(data) {
|
|
20459
|
-
|
|
20503
|
+
await handleAllSettled(
|
|
20460
20504
|
Object.values(this.portlets).map(async (portlet) => {
|
|
20461
20505
|
return portlet.dataChangeNotify(data);
|
|
20462
20506
|
})
|
|
20463
20507
|
);
|
|
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
20508
|
}
|
|
20470
20509
|
};
|
|
20471
20510
|
|
|
@@ -21809,16 +21848,11 @@ var FormController = class extends ControlController {
|
|
|
21809
21848
|
* @param {string[]} names
|
|
21810
21849
|
*/
|
|
21811
21850
|
async dataChangeNotify(names) {
|
|
21812
|
-
|
|
21851
|
+
await handleAllSettled(
|
|
21813
21852
|
Object.values(this.details).map(async (detail) => {
|
|
21814
21853
|
return detail.dataChangeNotify(names);
|
|
21815
21854
|
})
|
|
21816
21855
|
);
|
|
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
21856
|
}
|
|
21823
21857
|
/**
|
|
21824
21858
|
* 表单状态变更通知
|
|
@@ -22442,7 +22476,7 @@ var FormButtonController = class extends FormDetailController {
|
|
|
22442
22476
|
|
|
22443
22477
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts
|
|
22444
22478
|
import { isOverlap as isOverlap2 } from "@ibiz-template/core";
|
|
22445
|
-
import { createUUID as createUUID4, notNilEmpty as
|
|
22479
|
+
import { createUUID as createUUID4, notNilEmpty as notNilEmpty8 } from "qx-util";
|
|
22446
22480
|
|
|
22447
22481
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.state.ts
|
|
22448
22482
|
var FormDruipartState = class extends FormDetailState {
|
|
@@ -22537,7 +22571,7 @@ var FormDRUIPartController = class extends FormDetailController {
|
|
|
22537
22571
|
calcViewParams() {
|
|
22538
22572
|
let newContext = this.form.context.clone();
|
|
22539
22573
|
const navContexts = this.model.navigateContexts;
|
|
22540
|
-
if (
|
|
22574
|
+
if (notNilEmpty8(navContexts)) {
|
|
22541
22575
|
newContext = Object.assign(
|
|
22542
22576
|
newContext,
|
|
22543
22577
|
convertNavData(
|
|
@@ -23235,6 +23269,7 @@ import {
|
|
|
23235
23269
|
mergeDefaultInLeft as mergeDefaultInLeft2
|
|
23236
23270
|
} from "@ibiz-template/core";
|
|
23237
23271
|
import { debounce } from "lodash-es";
|
|
23272
|
+
import { clone as clone16 } from "ramda";
|
|
23238
23273
|
|
|
23239
23274
|
// src/controller/control/form/edit-form/edit-form.service.ts
|
|
23240
23275
|
import {
|
|
@@ -23477,7 +23512,7 @@ var EditFormService = class extends ControlService {
|
|
|
23477
23512
|
}
|
|
23478
23513
|
},
|
|
23479
23514
|
{
|
|
23480
|
-
childrenFields: ["deformPages", "deformDetails"]
|
|
23515
|
+
childrenFields: ["deformPages", "deformTabPages", "deformDetails"]
|
|
23481
23516
|
}
|
|
23482
23517
|
);
|
|
23483
23518
|
}
|
|
@@ -23516,6 +23551,9 @@ var EditFormService = class extends ControlService {
|
|
|
23516
23551
|
|
|
23517
23552
|
// src/controller/control/form/edit-form/edit-form.controller.ts
|
|
23518
23553
|
var EditFormController = class extends FormController {
|
|
23554
|
+
get view() {
|
|
23555
|
+
return this.ctx.view;
|
|
23556
|
+
}
|
|
23519
23557
|
/**
|
|
23520
23558
|
* 初始化方法
|
|
23521
23559
|
*
|
|
@@ -23570,6 +23608,51 @@ var EditFormController = class extends FormController {
|
|
|
23570
23608
|
this.state.isLoaded = true;
|
|
23571
23609
|
return this.data;
|
|
23572
23610
|
}
|
|
23611
|
+
/**
|
|
23612
|
+
* 拷贝模式加载数据
|
|
23613
|
+
*
|
|
23614
|
+
* @author chitanda
|
|
23615
|
+
* @date 2023-09-26 19:09:21
|
|
23616
|
+
* @return {*} {Promise<IData>}
|
|
23617
|
+
*/
|
|
23618
|
+
async copy() {
|
|
23619
|
+
const context = clone16(this.context);
|
|
23620
|
+
const queryParams = clone16(this.params);
|
|
23621
|
+
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
23622
|
+
this.model.appDataEntityId
|
|
23623
|
+
);
|
|
23624
|
+
const key = appDataEntity.keyAppDEFieldId;
|
|
23625
|
+
if (key && this.params[key]) {
|
|
23626
|
+
const deCodeName = calcDeCodeNameById(this.model.appDataEntityId);
|
|
23627
|
+
context[deCodeName] = this.params[key];
|
|
23628
|
+
delete queryParams[key];
|
|
23629
|
+
delete this.params[key];
|
|
23630
|
+
delete queryParams.srfcopymode;
|
|
23631
|
+
delete this.params.srfcopymode;
|
|
23632
|
+
}
|
|
23633
|
+
let res;
|
|
23634
|
+
try {
|
|
23635
|
+
await this.startLoading();
|
|
23636
|
+
await this.evt.emit("onBeforeLoad", void 0);
|
|
23637
|
+
res = await this.service.get(context, queryParams);
|
|
23638
|
+
} catch (error) {
|
|
23639
|
+
await this.evt.emit("onLoadError", void 0);
|
|
23640
|
+
this.actionNotification("GETERROR", {
|
|
23641
|
+
error
|
|
23642
|
+
});
|
|
23643
|
+
throw error;
|
|
23644
|
+
} finally {
|
|
23645
|
+
await this.endLoading();
|
|
23646
|
+
}
|
|
23647
|
+
res.data.$origin.srfsourcekey = void 0;
|
|
23648
|
+
this.state.modified = false;
|
|
23649
|
+
this.state.data = res.data;
|
|
23650
|
+
this.formStateNotify("LOAD" /* LOAD */);
|
|
23651
|
+
await this.evt.emit("onLoadSuccess", void 0);
|
|
23652
|
+
this.actionNotification("GETSUCCESS");
|
|
23653
|
+
this.state.isLoaded = true;
|
|
23654
|
+
return this.data;
|
|
23655
|
+
}
|
|
23573
23656
|
/**
|
|
23574
23657
|
* 部件加载数据行为
|
|
23575
23658
|
*
|
|
@@ -23577,6 +23660,10 @@ var EditFormController = class extends FormController {
|
|
|
23577
23660
|
* @date 2022-08-19 14:08:50
|
|
23578
23661
|
*/
|
|
23579
23662
|
async load() {
|
|
23663
|
+
const copyMode = this.params.srfcopymode;
|
|
23664
|
+
if (copyMode) {
|
|
23665
|
+
return this.copy();
|
|
23666
|
+
}
|
|
23580
23667
|
const isLoadDraft = !hasDeCodeName(
|
|
23581
23668
|
this.context,
|
|
23582
23669
|
this.model.appDataEntityId
|
|
@@ -23584,7 +23671,7 @@ var EditFormController = class extends FormController {
|
|
|
23584
23671
|
if (isLoadDraft) {
|
|
23585
23672
|
return this.loadDraft();
|
|
23586
23673
|
}
|
|
23587
|
-
const queryParams =
|
|
23674
|
+
const queryParams = clone16(this.params);
|
|
23588
23675
|
let res;
|
|
23589
23676
|
try {
|
|
23590
23677
|
await this.startLoading();
|
|
@@ -24857,7 +24944,7 @@ import {
|
|
|
24857
24944
|
RuntimeError as RuntimeError43,
|
|
24858
24945
|
RuntimeModelError as RuntimeModelError52
|
|
24859
24946
|
} from "@ibiz-template/core";
|
|
24860
|
-
import { clone as
|
|
24947
|
+
import { clone as clone17 } from "ramda";
|
|
24861
24948
|
|
|
24862
24949
|
// src/controller/control/grid/grid/grid.service.ts
|
|
24863
24950
|
var GridService = class extends MDControlService {
|
|
@@ -25087,10 +25174,11 @@ var GridController = class extends MDControlController {
|
|
|
25087
25174
|
}
|
|
25088
25175
|
async afterLoad(args, items) {
|
|
25089
25176
|
await super.afterLoad(args, items);
|
|
25090
|
-
await
|
|
25177
|
+
await handleAllSettled(
|
|
25091
25178
|
Object.values(this.fieldColumns).map(async (fieldColumn) => {
|
|
25092
25179
|
await fieldColumn.loadCodeList();
|
|
25093
|
-
})
|
|
25180
|
+
}),
|
|
25181
|
+
false
|
|
25094
25182
|
);
|
|
25095
25183
|
this.state.rows = items.map((item) => {
|
|
25096
25184
|
const row = new GridRowState(item, this);
|
|
@@ -25316,7 +25404,7 @@ var GridController = class extends MDControlController {
|
|
|
25316
25404
|
if (!needSaveData.length) {
|
|
25317
25405
|
return;
|
|
25318
25406
|
}
|
|
25319
|
-
|
|
25407
|
+
await handleAllSettled(
|
|
25320
25408
|
needSaveData.map((data) => {
|
|
25321
25409
|
return this.save(data);
|
|
25322
25410
|
})
|
|
@@ -25452,16 +25540,11 @@ var GridController = class extends MDControlController {
|
|
|
25452
25540
|
* @param {string[]} names 更新的属性
|
|
25453
25541
|
*/
|
|
25454
25542
|
async dataChangeNotify(row, names) {
|
|
25455
|
-
|
|
25543
|
+
await handleAllSettled(
|
|
25456
25544
|
Object.values(this.editColumns).map(async (column) => {
|
|
25457
25545
|
return column.dataChangeNotify(row, names);
|
|
25458
25546
|
})
|
|
25459
25547
|
);
|
|
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
25548
|
}
|
|
25466
25549
|
/**
|
|
25467
25550
|
* 表格状态变更通知
|
|
@@ -25526,7 +25609,7 @@ var GridController = class extends MDControlController {
|
|
|
25526
25609
|
throw new RuntimeError43("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
25527
25610
|
}
|
|
25528
25611
|
if (row.data.srfuf === 1 /* UPDATE */) {
|
|
25529
|
-
row.cacheData =
|
|
25612
|
+
row.cacheData = clone17(row.data);
|
|
25530
25613
|
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
25531
25614
|
Object.assign(row.data, defaultVal);
|
|
25532
25615
|
}
|
|
@@ -25643,7 +25726,7 @@ var GridController = class extends MDControlController {
|
|
|
25643
25726
|
codeListMap.set(key, items[key].codeListItems);
|
|
25644
25727
|
}
|
|
25645
25728
|
});
|
|
25646
|
-
const cloneData =
|
|
25729
|
+
const cloneData = clone17(
|
|
25647
25730
|
data2.map((item) => {
|
|
25648
25731
|
return item.getOrigin();
|
|
25649
25732
|
})
|
|
@@ -25753,7 +25836,7 @@ var GridController = class extends MDControlController {
|
|
|
25753
25836
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
25754
25837
|
import { DataTypes as DataTypes3, ModelError as ModelError26 } from "@ibiz-template/core";
|
|
25755
25838
|
import dayjs4 from "dayjs";
|
|
25756
|
-
import { clone as
|
|
25839
|
+
import { clone as clone18 } from "ramda";
|
|
25757
25840
|
var GridFieldColumnController = class extends GridColumnController {
|
|
25758
25841
|
constructor() {
|
|
25759
25842
|
super(...arguments);
|
|
@@ -25849,7 +25932,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
25849
25932
|
srfkey: value,
|
|
25850
25933
|
...wfContext
|
|
25851
25934
|
});
|
|
25852
|
-
const tempParams =
|
|
25935
|
+
const tempParams = clone18(this.params);
|
|
25853
25936
|
const { context: newContext, params: newParams } = this.handlePublicParams(
|
|
25854
25937
|
row.data,
|
|
25855
25938
|
tempContext,
|
|
@@ -27488,7 +27571,7 @@ var TreeService = class extends MDControlService {
|
|
|
27488
27571
|
if (childNodeRSs.length === 0) {
|
|
27489
27572
|
return;
|
|
27490
27573
|
}
|
|
27491
|
-
const results = await
|
|
27574
|
+
const results = await handleAllSettled(
|
|
27492
27575
|
childNodeRSs.map(async (childNodeRS) => {
|
|
27493
27576
|
const childNode = getTreeNode(
|
|
27494
27577
|
this.model,
|
|
@@ -27500,14 +27583,11 @@ var TreeService = class extends MDControlService {
|
|
|
27500
27583
|
parentNodeData,
|
|
27501
27584
|
opts
|
|
27502
27585
|
);
|
|
27503
|
-
})
|
|
27586
|
+
}),
|
|
27587
|
+
false
|
|
27504
27588
|
);
|
|
27505
27589
|
results.forEach((result) => {
|
|
27506
|
-
|
|
27507
|
-
childrenNodes.push(...result.value);
|
|
27508
|
-
} else if (result.status === "rejected") {
|
|
27509
|
-
ibiz.log.error(result.reason);
|
|
27510
|
-
}
|
|
27590
|
+
childrenNodes.push(...result);
|
|
27511
27591
|
});
|
|
27512
27592
|
}
|
|
27513
27593
|
return childrenNodes;
|
|
@@ -27678,9 +27758,9 @@ var TreeService = class extends MDControlService {
|
|
|
27678
27758
|
navParams: {}
|
|
27679
27759
|
};
|
|
27680
27760
|
params.size = nodeModel.maxSize || 1e3;
|
|
27681
|
-
if (nodeModel.sortAppDEFieldId
|
|
27761
|
+
if (nodeModel.sortAppDEFieldId) {
|
|
27682
27762
|
Object.assign(params, {
|
|
27683
|
-
sort: "".concat(nodeModel.sortAppDEFieldId.toLowerCase(), ",").concat(nodeModel.sortDir.toLowerCase())
|
|
27763
|
+
sort: "".concat(nodeModel.sortAppDEFieldId.toLowerCase(), ",").concat(nodeModel.sortDir ? nodeModel.sortDir.toLowerCase() : "asc")
|
|
27684
27764
|
});
|
|
27685
27765
|
}
|
|
27686
27766
|
const response = await this.app.deService.exec(
|
|
@@ -29670,6 +29750,7 @@ var ViewEngineBase = class {
|
|
|
29670
29750
|
|
|
29671
29751
|
// src/engine/md-view.engine.ts
|
|
29672
29752
|
import { RuntimeModelError as RuntimeModelError55 } from "@ibiz-template/core";
|
|
29753
|
+
import { clone as clone19 } from "ramda";
|
|
29673
29754
|
var MDViewEngine = class extends ViewEngineBase {
|
|
29674
29755
|
/**
|
|
29675
29756
|
* 多数据部件名称
|
|
@@ -29866,13 +29947,13 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
29866
29947
|
if (!openAppViewLogic) {
|
|
29867
29948
|
throw new RuntimeModelError55(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
|
|
29868
29949
|
}
|
|
29869
|
-
const
|
|
29950
|
+
const params = clone19(this.view.params);
|
|
29870
29951
|
if (copyMode) {
|
|
29871
|
-
|
|
29952
|
+
params.srfcopymode = copyMode;
|
|
29872
29953
|
}
|
|
29873
29954
|
const result = await ((_c = this.view.scheduler) == null ? void 0 : _c.triggerCustom("newdata", {
|
|
29874
|
-
context,
|
|
29875
|
-
params
|
|
29955
|
+
context: this.view.context,
|
|
29956
|
+
params,
|
|
29876
29957
|
data,
|
|
29877
29958
|
event,
|
|
29878
29959
|
view: this.view
|
|
@@ -30016,6 +30097,90 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
30016
30097
|
}
|
|
30017
30098
|
};
|
|
30018
30099
|
|
|
30100
|
+
// src/utils/error-handler/default-error-handler.ts
|
|
30101
|
+
import {
|
|
30102
|
+
RuntimeModelError as RuntimeModelError56,
|
|
30103
|
+
ModelError as ModelError28,
|
|
30104
|
+
HttpError as HttpError4,
|
|
30105
|
+
NoticeError as NoticeError2,
|
|
30106
|
+
RuntimeError as RuntimeError50
|
|
30107
|
+
} from "@ibiz-template/core";
|
|
30108
|
+
var DefaultErrorHandler = class {
|
|
30109
|
+
handle(error) {
|
|
30110
|
+
if (error instanceof RuntimeModelError56 || error instanceof ModelError28) {
|
|
30111
|
+
ibiz.message.error(error.message, 10, true);
|
|
30112
|
+
} else if (error instanceof HttpError4) {
|
|
30113
|
+
if (error.status === 401) {
|
|
30114
|
+
ibiz.message.error("\u6CA1\u6709\u6CE8\u518C\u65E0\u6743\u9650\u9519\u8BEF\u5904\u7406\u5668");
|
|
30115
|
+
} else {
|
|
30116
|
+
ibiz.notification.error({
|
|
30117
|
+
title: "",
|
|
30118
|
+
desc: error.message,
|
|
30119
|
+
duration: 10
|
|
30120
|
+
});
|
|
30121
|
+
}
|
|
30122
|
+
} else if (error instanceof NoticeError2) {
|
|
30123
|
+
ibiz.message.error(error.message, error.duration, error.duration === 0);
|
|
30124
|
+
} else if (error instanceof RuntimeError50) {
|
|
30125
|
+
ibiz.message.error(error.message, 10, true);
|
|
30126
|
+
}
|
|
30127
|
+
ibiz.log.error(error);
|
|
30128
|
+
return true;
|
|
30129
|
+
}
|
|
30130
|
+
};
|
|
30131
|
+
|
|
30132
|
+
// src/utils/error-handler/error-handler-center.ts
|
|
30133
|
+
var ErrorHandlerCenter = class {
|
|
30134
|
+
constructor() {
|
|
30135
|
+
/**
|
|
30136
|
+
* 处理器集合
|
|
30137
|
+
* @author lxm
|
|
30138
|
+
* @date 2023-09-26 04:56:29
|
|
30139
|
+
* @type {IErrorHandler[]}
|
|
30140
|
+
*/
|
|
30141
|
+
this.handlers = [];
|
|
30142
|
+
}
|
|
30143
|
+
/**
|
|
30144
|
+
* 注册处理器(后注册的优先级更高)
|
|
30145
|
+
* @author lxm
|
|
30146
|
+
* @date 2023-09-26 04:59:06
|
|
30147
|
+
* @param {IErrorHandler} handler
|
|
30148
|
+
*/
|
|
30149
|
+
register(handler) {
|
|
30150
|
+
this.handlers.unshift(handler);
|
|
30151
|
+
}
|
|
30152
|
+
/**
|
|
30153
|
+
* 处理单个报错
|
|
30154
|
+
* @author lxm
|
|
30155
|
+
* @date 2023-09-26 05:18:18
|
|
30156
|
+
* @protected
|
|
30157
|
+
* @param {unknown} error
|
|
30158
|
+
*/
|
|
30159
|
+
handleSingle(error) {
|
|
30160
|
+
const find = this.handlers.find((item) => {
|
|
30161
|
+
return !!item.handle(error);
|
|
30162
|
+
});
|
|
30163
|
+
if (!find) {
|
|
30164
|
+
ibiz.log.error("\u6CA1\u6709\u627E\u5230\u80FD\u5904\u7406\u8BE5\u9519\u8BEF\u7684\u5904\u7406\u5668", error);
|
|
30165
|
+
}
|
|
30166
|
+
}
|
|
30167
|
+
/**
|
|
30168
|
+
* 按顺序检测处理器,最先满足条件的处理该异常
|
|
30169
|
+
* @author lxm
|
|
30170
|
+
* @date 2023-09-26 05:01:08
|
|
30171
|
+
* @param {unknown} error
|
|
30172
|
+
*/
|
|
30173
|
+
handle(error) {
|
|
30174
|
+
if (error instanceof Array) {
|
|
30175
|
+
error.forEach((item) => {
|
|
30176
|
+
this.handleSingle(item);
|
|
30177
|
+
});
|
|
30178
|
+
} else {
|
|
30179
|
+
this.handleSingle(error);
|
|
30180
|
+
}
|
|
30181
|
+
}
|
|
30182
|
+
};
|
|
30183
|
+
|
|
30019
30184
|
// src/global/global-util/global-util.ts
|
|
30020
30185
|
var GlobalUtil = class {
|
|
30021
30186
|
constructor() {
|
|
@@ -30047,6 +30212,13 @@ var GlobalUtil = class {
|
|
|
30047
30212
|
* @date 2023-08-24 11:08:28
|
|
30048
30213
|
*/
|
|
30049
30214
|
this.rawValue = new RawValueUtil();
|
|
30215
|
+
/**
|
|
30216
|
+
* 错误处理中心
|
|
30217
|
+
* @author lxm
|
|
30218
|
+
* @date 2023-09-26 05:04:26
|
|
30219
|
+
*/
|
|
30220
|
+
this.error = new ErrorHandlerCenter();
|
|
30221
|
+
this.error.register(new DefaultErrorHandler());
|
|
30050
30222
|
}
|
|
30051
30223
|
/**
|
|
30052
30224
|
* 显示应用级别的加载提示
|
|
@@ -30077,7 +30249,7 @@ var GlobalUtil = class {
|
|
|
30077
30249
|
};
|
|
30078
30250
|
|
|
30079
30251
|
// src/logic-scheduler/executor/logic-executor.ts
|
|
30080
|
-
import { RuntimeError as
|
|
30252
|
+
import { RuntimeError as RuntimeError51 } from "@ibiz-template/core";
|
|
30081
30253
|
var LogicExecutor = class {
|
|
30082
30254
|
/**
|
|
30083
30255
|
* @author lxm
|
|
@@ -30098,7 +30270,7 @@ var LogicExecutor = class {
|
|
|
30098
30270
|
*/
|
|
30099
30271
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30100
30272
|
execute(_executeParams) {
|
|
30101
|
-
throw new
|
|
30273
|
+
throw new RuntimeError51("Method not implemented.");
|
|
30102
30274
|
}
|
|
30103
30275
|
/**
|
|
30104
30276
|
* 销毁方法
|
|
@@ -30110,7 +30282,7 @@ var LogicExecutor = class {
|
|
|
30110
30282
|
};
|
|
30111
30283
|
|
|
30112
30284
|
// src/logic-scheduler/executor/logic-executor-factory.ts
|
|
30113
|
-
import { ModelError as
|
|
30285
|
+
import { ModelError as ModelError29 } from "@ibiz-template/core";
|
|
30114
30286
|
var LogicExecutorFactory = class {
|
|
30115
30287
|
constructor() {
|
|
30116
30288
|
/**
|
|
@@ -30140,7 +30312,7 @@ var LogicExecutorFactory = class {
|
|
|
30140
30312
|
createExecutor(logic, scheduler) {
|
|
30141
30313
|
const constructor = this.constructorMap.get(logic.logicType);
|
|
30142
30314
|
if (!constructor) {
|
|
30143
|
-
throw new
|
|
30315
|
+
throw new ModelError29(logic, "\u903B\u8F91\u7C7B\u578B ".concat(logic.logicType, " \u6682\u672A\u652F\u6301\uFF01"));
|
|
30144
30316
|
}
|
|
30145
30317
|
return constructor(logic, scheduler);
|
|
30146
30318
|
}
|
|
@@ -30189,13 +30361,13 @@ var ScriptExecutor = class extends LogicExecutor {
|
|
|
30189
30361
|
};
|
|
30190
30362
|
|
|
30191
30363
|
// src/logic-scheduler/executor/app-de-ui-logic-executor.ts
|
|
30192
|
-
import { RuntimeModelError as
|
|
30364
|
+
import { RuntimeModelError as RuntimeModelError57 } from "@ibiz-template/core";
|
|
30193
30365
|
var AppDEUILogicExecutor = class extends LogicExecutor {
|
|
30194
30366
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30195
30367
|
execute(executeParams) {
|
|
30196
30368
|
const { appDEUILogicId, appDataEntityId } = this.logic;
|
|
30197
30369
|
if (!appDEUILogicId) {
|
|
30198
|
-
throw new
|
|
30370
|
+
throw new RuntimeModelError57(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
|
|
30199
30371
|
}
|
|
30200
30372
|
execUILogic(appDEUILogicId, appDataEntityId, executeParams);
|
|
30201
30373
|
}
|
|
@@ -30453,7 +30625,7 @@ var ViewLogicScheduler = class extends LogicScheduler {
|
|
|
30453
30625
|
};
|
|
30454
30626
|
|
|
30455
30627
|
// src/logic-scheduler/trigger/logic-trigger-factory.ts
|
|
30456
|
-
import { ModelError as
|
|
30628
|
+
import { ModelError as ModelError30 } from "@ibiz-template/core";
|
|
30457
30629
|
var LogicTriggerFactory = class {
|
|
30458
30630
|
constructor() {
|
|
30459
30631
|
/**
|
|
@@ -30483,7 +30655,7 @@ var LogicTriggerFactory = class {
|
|
|
30483
30655
|
createTrigger(logic, scheduler) {
|
|
30484
30656
|
const constructor = this.constructorMap.get(logic.triggerType);
|
|
30485
30657
|
if (!constructor) {
|
|
30486
|
-
throw new
|
|
30658
|
+
throw new ModelError30(logic, "\u89E6\u53D1\u5668\u7C7B\u578B ".concat(logic.triggerType, " \u6682\u672A\u652F\u6301\uFF01"));
|
|
30487
30659
|
}
|
|
30488
30660
|
return constructor(logic, scheduler);
|
|
30489
30661
|
}
|
|
@@ -30530,7 +30702,7 @@ var LogicSchedulerCenter = class {
|
|
|
30530
30702
|
};
|
|
30531
30703
|
|
|
30532
30704
|
// src/logic-scheduler/trigger/logic-trigger.ts
|
|
30533
|
-
import { RuntimeError as
|
|
30705
|
+
import { RuntimeError as RuntimeError52 } from "@ibiz-template/core";
|
|
30534
30706
|
var LogicTrigger = class {
|
|
30535
30707
|
/**
|
|
30536
30708
|
* @author lxm
|
|
@@ -30590,7 +30762,7 @@ var LogicTrigger = class {
|
|
|
30590
30762
|
if (this.executor) {
|
|
30591
30763
|
return this.executor.execute(executeParams);
|
|
30592
30764
|
}
|
|
30593
|
-
throw new
|
|
30765
|
+
throw new RuntimeError52("".concat(this.logic.id, "\u6CA1\u6709\u7ED1\u5B9Aexecutor"));
|
|
30594
30766
|
}
|
|
30595
30767
|
/**
|
|
30596
30768
|
* 销毁方法
|
|
@@ -30607,12 +30779,12 @@ var CustomTrigger = class extends LogicTrigger {
|
|
|
30607
30779
|
};
|
|
30608
30780
|
|
|
30609
30781
|
// src/logic-scheduler/trigger/item-dyna-logic-trigger.ts
|
|
30610
|
-
import { RuntimeError as
|
|
30782
|
+
import { RuntimeError as RuntimeError53 } from "@ibiz-template/core";
|
|
30611
30783
|
var ItemDynaLogicTrigger = class extends LogicTrigger {
|
|
30612
30784
|
bindExecutor(executor) {
|
|
30613
30785
|
super.bindExecutor(executor);
|
|
30614
30786
|
if (this.executor.type !== "SCRIPT") {
|
|
30615
|
-
throw new
|
|
30787
|
+
throw new RuntimeError53(
|
|
30616
30788
|
"\u9884\u5B9A\u4E49\u903B\u8F91\u7C7B\u578B".concat(this.type, "\u7684\u89E6\u53D1\u5668\u7C7B\u578B\u53EA\u80FD\u662F\u811A\u672C")
|
|
30617
30789
|
);
|
|
30618
30790
|
}
|
|
@@ -30643,15 +30815,12 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
|
|
|
30643
30815
|
}
|
|
30644
30816
|
execute(executeParams) {
|
|
30645
30817
|
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"));
|
|
30818
|
+
return !!result;
|
|
30650
30819
|
}
|
|
30651
30820
|
};
|
|
30652
30821
|
|
|
30653
30822
|
// src/logic-scheduler/trigger/timer-trigger.ts
|
|
30654
|
-
import { RuntimeError as
|
|
30823
|
+
import { RuntimeError as RuntimeError54 } from "@ibiz-template/core";
|
|
30655
30824
|
var TimerTrigger = class extends LogicTrigger {
|
|
30656
30825
|
constructor() {
|
|
30657
30826
|
super(...arguments);
|
|
@@ -30660,7 +30829,7 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
30660
30829
|
start() {
|
|
30661
30830
|
this.timer = setInterval(() => {
|
|
30662
30831
|
if (!this.scheduler.defaultParamsCb) {
|
|
30663
|
-
throw new
|
|
30832
|
+
throw new RuntimeError54("\u5B9A\u65F6\u5668\u7F3A\u5C11\u9ED8\u8BA4\u53C2\u6570\u56DE\u8C03");
|
|
30664
30833
|
}
|
|
30665
30834
|
const params = this.scheduler.defaultParamsCb();
|
|
30666
30835
|
this.executor.execute(params);
|
|
@@ -30676,11 +30845,11 @@ var TimerTrigger = class extends LogicTrigger {
|
|
|
30676
30845
|
|
|
30677
30846
|
// src/logic-scheduler/executor/app-ui-logic-executor.ts
|
|
30678
30847
|
import {
|
|
30679
|
-
ModelError as
|
|
30680
|
-
RuntimeError as
|
|
30681
|
-
RuntimeModelError as
|
|
30848
|
+
ModelError as ModelError31,
|
|
30849
|
+
RuntimeError as RuntimeError55,
|
|
30850
|
+
RuntimeModelError as RuntimeModelError58
|
|
30682
30851
|
} from "@ibiz-template/core";
|
|
30683
|
-
import { notNilEmpty as
|
|
30852
|
+
import { notNilEmpty as notNilEmpty9 } from "qx-util";
|
|
30684
30853
|
var AppUILogicExecutor = class extends LogicExecutor {
|
|
30685
30854
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30686
30855
|
execute(executeParams) {
|
|
@@ -30713,7 +30882,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30713
30882
|
const { context, params, ...rest } = parameters;
|
|
30714
30883
|
const { data } = parameters;
|
|
30715
30884
|
if (!(data == null ? void 0 : data[0])) {
|
|
30716
|
-
throw new
|
|
30885
|
+
throw new RuntimeError55("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
|
|
30717
30886
|
}
|
|
30718
30887
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
30719
30888
|
let openViewRef;
|
|
@@ -30722,7 +30891,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30722
30891
|
} else {
|
|
30723
30892
|
openViewRef = appUILogic.openDataAppView;
|
|
30724
30893
|
if (!openViewRef) {
|
|
30725
|
-
throw new
|
|
30894
|
+
throw new RuntimeModelError58(
|
|
30726
30895
|
appUILogic,
|
|
30727
30896
|
"opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
|
|
30728
30897
|
);
|
|
@@ -30730,7 +30899,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30730
30899
|
}
|
|
30731
30900
|
const openView = openViewRef.refAppViewId;
|
|
30732
30901
|
if (!openView) {
|
|
30733
|
-
throw new
|
|
30902
|
+
throw new RuntimeModelError58(
|
|
30734
30903
|
appUILogic,
|
|
30735
30904
|
"opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
|
|
30736
30905
|
);
|
|
@@ -30742,7 +30911,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30742
30911
|
);
|
|
30743
30912
|
let tempParams = {};
|
|
30744
30913
|
const navParams = openViewRef.navigateParams;
|
|
30745
|
-
if (
|
|
30914
|
+
if (notNilEmpty9(navParams)) {
|
|
30746
30915
|
tempParams = convertNavData(navParams, data[0], params, context);
|
|
30747
30916
|
}
|
|
30748
30917
|
return ibiz.commands.execute(
|
|
@@ -30757,7 +30926,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30757
30926
|
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
30758
30927
|
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
30759
30928
|
if (!formTypeName) {
|
|
30760
|
-
throw new
|
|
30929
|
+
throw new RuntimeModelError58(
|
|
30761
30930
|
appUILogic,
|
|
30762
30931
|
"".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
|
|
30763
30932
|
);
|
|
@@ -30765,12 +30934,12 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30765
30934
|
const { data } = parameters;
|
|
30766
30935
|
const formTypeValue = data[0][formTypeName];
|
|
30767
30936
|
if (!formTypeValue) {
|
|
30768
|
-
throw new
|
|
30937
|
+
throw new RuntimeModelError58(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
30769
30938
|
}
|
|
30770
30939
|
const openViewRefs = appUILogic.openDataAppViews;
|
|
30771
30940
|
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
30772
30941
|
if (!findView) {
|
|
30773
|
-
throw new
|
|
30942
|
+
throw new RuntimeError55(
|
|
30774
30943
|
"\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
30775
30944
|
);
|
|
30776
30945
|
}
|
|
@@ -30807,17 +30976,17 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30807
30976
|
return viewRef.refMode.toLowerCase() !== parentDeName;
|
|
30808
30977
|
});
|
|
30809
30978
|
if (!newViewRef) {
|
|
30810
|
-
throw new
|
|
30979
|
+
throw new RuntimeModelError58(
|
|
30811
30980
|
appUILogic,
|
|
30812
30981
|
"\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
|
|
30813
30982
|
);
|
|
30814
30983
|
}
|
|
30815
30984
|
} else if (batchAddOnly) {
|
|
30816
|
-
throw new
|
|
30985
|
+
throw new ModelError31(appUILogic, "batchAddOnly\u6682\u672A\u652F\u6301");
|
|
30817
30986
|
} else {
|
|
30818
30987
|
newViewRef = newDataAppView;
|
|
30819
30988
|
if (!newViewRef || !newViewRef.refAppViewId) {
|
|
30820
|
-
throw new
|
|
30989
|
+
throw new RuntimeModelError58(
|
|
30821
30990
|
appUILogic,
|
|
30822
30991
|
"newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
|
|
30823
30992
|
);
|
|
@@ -30827,18 +30996,25 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30827
30996
|
let tempParams = {};
|
|
30828
30997
|
const _data = (data == null ? void 0 : data[0]) || {};
|
|
30829
30998
|
const navContexts = newViewRef.navigateContexts;
|
|
30830
|
-
if (
|
|
30999
|
+
if (notNilEmpty9(navContexts)) {
|
|
30831
31000
|
tempContext = convertNavData(navContexts, _data, params, context);
|
|
30832
31001
|
}
|
|
30833
31002
|
tempContext = Object.assign(context, tempContext);
|
|
30834
31003
|
const navParams = newViewRef.navigateParams;
|
|
30835
|
-
if (
|
|
31004
|
+
if (notNilEmpty9(navParams)) {
|
|
30836
31005
|
tempParams = convertNavData(navParams, _data, params, context);
|
|
30837
31006
|
}
|
|
30838
|
-
if (
|
|
30839
|
-
|
|
30840
|
-
|
|
31007
|
+
if (params.srfcopymode) {
|
|
31008
|
+
const entity = await ibiz.hub.getAppDataEntity(
|
|
31009
|
+
view.model.appDataEntityId
|
|
31010
|
+
);
|
|
31011
|
+
const key = entity.keyAppDEFieldId;
|
|
31012
|
+
if (key && _data) {
|
|
31013
|
+
tempParams[key] = _data.srfkey;
|
|
31014
|
+
tempParams.srfcopymode = true;
|
|
31015
|
+
}
|
|
30841
31016
|
}
|
|
31017
|
+
tempParams.srfuf = 0 /* CREATE */;
|
|
30842
31018
|
const result = await ibiz.commands.execute(
|
|
30843
31019
|
OpenAppViewCommand.TAG,
|
|
30844
31020
|
newViewRef.refAppViewId,
|
|
@@ -30867,7 +31043,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30867
31043
|
const { wizardAppView, newDataAppViews } = appUILogic;
|
|
30868
31044
|
const { context, params, ...rest } = parameters;
|
|
30869
31045
|
if (!wizardAppView || !wizardAppView.refAppViewId) {
|
|
30870
|
-
throw new
|
|
31046
|
+
throw new RuntimeModelError58(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
|
|
30871
31047
|
}
|
|
30872
31048
|
const result = await ibiz.commands.execute(
|
|
30873
31049
|
OpenAppViewCommand.TAG,
|
|
@@ -30881,12 +31057,12 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30881
31057
|
}
|
|
30882
31058
|
const selectData = (_a = result.data) == null ? void 0 : _a[0];
|
|
30883
31059
|
if (!selectData) {
|
|
30884
|
-
throw new
|
|
31060
|
+
throw new RuntimeError55("\u8BF7\u9009\u4E2D\u4E00\u6761\u6570\u636E");
|
|
30885
31061
|
}
|
|
30886
31062
|
const indexType = selectData.srfkey;
|
|
30887
31063
|
const findView = newDataAppViews == null ? void 0 : newDataAppViews.find((item) => item.refMode === indexType);
|
|
30888
31064
|
if (!findView) {
|
|
30889
|
-
throw new
|
|
31065
|
+
throw new RuntimeError55(
|
|
30890
31066
|
"\u6CA1\u6709\u627E\u5230\u4E0E\u7D22\u5F15\u7C7B\u578B".concat(indexType, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
30891
31067
|
);
|
|
30892
31068
|
}
|
|
@@ -30913,7 +31089,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
30913
31089
|
const minorDERs = selfDe.minorAppDERSs;
|
|
30914
31090
|
const pickParentDeName = newViewRef.refMode.toLowerCase();
|
|
30915
31091
|
if (!minorDERs) {
|
|
30916
|
-
throw new
|
|
31092
|
+
throw new RuntimeModelError58(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
|
|
30917
31093
|
}
|
|
30918
31094
|
let pickParentFieldName;
|
|
30919
31095
|
minorDERs == null ? void 0 : minorDERs.forEach((item) => {
|
|
@@ -31387,6 +31563,7 @@ export {
|
|
|
31387
31563
|
getViewProvider,
|
|
31388
31564
|
getWFContext,
|
|
31389
31565
|
getWFSubmitViewId,
|
|
31566
|
+
handleAllSettled,
|
|
31390
31567
|
hasDeCodeName,
|
|
31391
31568
|
install,
|
|
31392
31569
|
installCommand,
|