@ibiz-template/runtime 0.1.25 → 0.1.27
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 +614 -297
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/control/md-control.controller.d.ts +1 -0
- package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
- package/out/controller/common/control/md-control.controller.js +7 -0
- package/out/controller/control/data-view/data-view.controller.d.ts +42 -1
- package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
- package/out/controller/control/data-view/data-view.controller.js +126 -0
- package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
- package/out/controller/control/exp-bar/exp-bar.controller.js +4 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +1 -0
- 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 +7 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +10 -68
- package/out/controller/control/form/search-form/search-form.controller.d.ts +1 -0
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +7 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts +1 -0
- package/out/controller/control/grid/grid/grid-row.state.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts +10 -0
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +61 -17
- package/out/controller/control/kanban/kanban.controller.d.ts +1 -34
- package/out/controller/control/kanban/kanban.controller.d.ts.map +1 -1
- package/out/controller/control/kanban/kanban.controller.js +0 -83
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts +20 -0
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.d.ts.map +1 -1
- package/out/controller/control/tab-exp-panel/tab-exp-panel.controller.js +45 -0
- package/out/controller/utils/index.d.ts +1 -0
- package/out/controller/utils/index.d.ts.map +1 -1
- package/out/controller/utils/index.js +1 -0
- package/out/controller/utils/value-default/value-default.d.ts +37 -0
- package/out/controller/utils/value-default/value-default.d.ts.map +1 -0
- package/out/controller/utils/value-default/value-default.js +65 -0
- package/out/de-logic/de-logic-node/end-node/end-node.d.ts.map +1 -1
- package/out/de-logic/de-logic-node/end-node/end-node.js +5 -1
- package/out/de-logic/utils/handle-src-val.js +1 -1
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +7 -0
- package/out/global/global-util/global-util.d.ts +8 -1
- package/out/global/global-util/global-util.d.ts.map +1 -1
- package/out/global/global-util/global-util.js +8 -1
- package/out/interface/controller/state/control/i-control.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-data-view-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-grid.state.d.ts +7 -0
- package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-kanban.state.d.ts +0 -8
- package/out/interface/controller/state/control/i-kanban.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-md-control.state.d.ts +14 -0
- package/out/interface/controller/state/control/i-md-control.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-tab-exp-panel.state.d.ts.map +1 -1
- package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +13 -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 +106 -24
- package/out/model/layout/layout.d.ts.map +1 -1
- package/out/model/layout/layout.js +17 -1
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/control/control.service.js +1 -1
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +1 -1
- package/out/service/service/entity/method/de-action.d.ts +1 -1
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +7 -7
- package/out/service/service/entity/method/method.d.ts +2 -2
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/types.d.ts +11 -0
- package/out/types.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/end-node/end-node.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/end-node/end-node.js +5 -1
- package/out/ui-logic/utils/handle-src-val.js +1 -1
- 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/raw-value-util/raw-value-util.d.ts +23 -0
- package/out/utils/raw-value-util/raw-value-util.d.ts.map +1 -0
- package/out/utils/raw-value-util/raw-value-util.js +37 -0
- package/package.json +4 -4
- package/src/controller/common/control/md-control.controller.ts +9 -0
- package/src/controller/control/data-view/data-view.controller.ts +147 -0
- package/src/controller/control/exp-bar/exp-bar.controller.ts +5 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +9 -0
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +13 -67
- package/src/controller/control/form/search-form/search-form.controller.ts +9 -0
- package/src/controller/control/grid/grid/grid-row.state.ts +2 -0
- package/src/controller/control/grid/grid/grid.controller.ts +69 -18
- package/src/controller/control/kanban/kanban.controller.ts +1 -98
- package/src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts +45 -0
- package/src/controller/utils/index.ts +1 -0
- package/src/controller/utils/value-default/value-default.ts +110 -0
- package/src/de-logic/de-logic-node/end-node/end-node.ts +7 -1
- package/src/de-logic/utils/handle-src-val.ts +1 -1
- package/src/engine/md-view.engine.ts +8 -0
- package/src/global/global-util/global-util.ts +14 -1
- package/src/interface/controller/state/control/i-control.state.ts +8 -0
- package/src/interface/controller/state/control/i-data-view-control.state.ts +10 -1
- package/src/interface/controller/state/control/i-grid.state.ts +8 -0
- package/src/interface/controller/state/control/i-kanban.state.ts +0 -9
- package/src/interface/controller/state/control/i-md-control.state.ts +16 -0
- package/src/interface/controller/state/control/i-tab-exp-panel.state.ts +9 -0
- package/src/logic-scheduler/executor/app-ui-logic-executor.ts +129 -30
- package/src/model/layout/layout.ts +16 -2
- package/src/service/service/control/control.service.ts +2 -2
- package/src/service/service/entity/de.service.ts +2 -2
- package/src/service/service/entity/method/de-action.ts +18 -12
- package/src/service/service/entity/method/method.ts +6 -6
- package/src/types.ts +12 -0
- package/src/ui-logic/ui-logic-node/end-node/end-node.ts +7 -1
- package/src/ui-logic/utils/handle-src-val.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/raw-value-util/raw-value-util.ts +37 -0
package/dist/index.esm.js
CHANGED
|
@@ -71,10 +71,10 @@ var require_utils = __commonJS({
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
exports.isFunction = isFunction2;
|
|
74
|
-
var
|
|
74
|
+
var isArray6 = Array.isArray || function(value) {
|
|
75
75
|
return value && typeof value === "object" ? toString.call(value) === "[object Array]" : false;
|
|
76
76
|
};
|
|
77
|
-
exports.isArray =
|
|
77
|
+
exports.isArray = isArray6;
|
|
78
78
|
function indexOf(array, value) {
|
|
79
79
|
for (var i = 0, len = array.length; i < len; i++) {
|
|
80
80
|
if (array[i] === value) {
|
|
@@ -102,7 +102,7 @@ var require_utils = __commonJS({
|
|
|
102
102
|
function isEmpty9(value) {
|
|
103
103
|
if (!value && value !== 0) {
|
|
104
104
|
return true;
|
|
105
|
-
} else if (
|
|
105
|
+
} else if (isArray6(value) && value.length === 0) {
|
|
106
106
|
return true;
|
|
107
107
|
} else {
|
|
108
108
|
return false;
|
|
@@ -6832,6 +6832,7 @@ function parseUserParams(userParams) {
|
|
|
6832
6832
|
}
|
|
6833
6833
|
|
|
6834
6834
|
// src/model/layout/layout.ts
|
|
6835
|
+
import { isArray as isArray2, isObject, isString } from "lodash-es";
|
|
6835
6836
|
function calcLayoutHeightWidth(layoutPos) {
|
|
6836
6837
|
const { width, height, widthMode, heightMode } = layoutPos;
|
|
6837
6838
|
const result = { width: "", height: "" };
|
|
@@ -6926,10 +6927,23 @@ function calcGridLayoutPos(layoutPos) {
|
|
|
6926
6927
|
};
|
|
6927
6928
|
}
|
|
6928
6929
|
function calcDynaClass(expression, data) {
|
|
6929
|
-
|
|
6930
|
+
const classArr = [];
|
|
6931
|
+
const result = ScriptFactory.execScriptFn({ data }, expression, {
|
|
6930
6932
|
singleRowReturn: true,
|
|
6931
6933
|
isAsync: false
|
|
6932
6934
|
});
|
|
6935
|
+
if (isString(result)) {
|
|
6936
|
+
classArr.push(result);
|
|
6937
|
+
} else if (isArray2(result)) {
|
|
6938
|
+
classArr.push(...result);
|
|
6939
|
+
} else if (isObject(result)) {
|
|
6940
|
+
Object.keys(result).forEach((key) => {
|
|
6941
|
+
if (result[key]) {
|
|
6942
|
+
classArr.push(key);
|
|
6943
|
+
}
|
|
6944
|
+
});
|
|
6945
|
+
}
|
|
6946
|
+
return classArr;
|
|
6933
6947
|
}
|
|
6934
6948
|
|
|
6935
6949
|
// src/model/main-state/main-state.ts
|
|
@@ -8579,6 +8593,36 @@ var TextUtil = class {
|
|
|
8579
8593
|
}
|
|
8580
8594
|
};
|
|
8581
8595
|
|
|
8596
|
+
// src/utils/raw-value-util/raw-value-util.ts
|
|
8597
|
+
var RawValueUtil = class {
|
|
8598
|
+
/**
|
|
8599
|
+
* 字符串是否完全由整数/浮点数组成
|
|
8600
|
+
*
|
|
8601
|
+
* @param {string} str
|
|
8602
|
+
* @return {*}
|
|
8603
|
+
*/
|
|
8604
|
+
isNumber(str) {
|
|
8605
|
+
return /^-?\d+(\.\d+)?$/.test(str);
|
|
8606
|
+
}
|
|
8607
|
+
/**
|
|
8608
|
+
* 转换直接值
|
|
8609
|
+
*
|
|
8610
|
+
* @param {string} val
|
|
8611
|
+
* @return {*}
|
|
8612
|
+
*/
|
|
8613
|
+
format(val) {
|
|
8614
|
+
let tempVal = val;
|
|
8615
|
+
if (val !== void 0) {
|
|
8616
|
+
if (val === "true" || val === "false") {
|
|
8617
|
+
tempVal = val === "true";
|
|
8618
|
+
} else if (this.isNumber(val)) {
|
|
8619
|
+
tempVal = parseFloat(val);
|
|
8620
|
+
}
|
|
8621
|
+
}
|
|
8622
|
+
return tempVal;
|
|
8623
|
+
}
|
|
8624
|
+
};
|
|
8625
|
+
|
|
8582
8626
|
// src/command/app/open-app-view/open-app-view.ts
|
|
8583
8627
|
import { ModelError as ModelError3, RuntimeError as RuntimeError4 } from "@ibiz-template/core";
|
|
8584
8628
|
var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
@@ -12010,6 +12054,9 @@ var EndNode = class extends DELogicNode {
|
|
|
12010
12054
|
async exec(ctx) {
|
|
12011
12055
|
ctx.isEndNode = true;
|
|
12012
12056
|
const { returnParamId, returnType, rawValue } = this.model;
|
|
12057
|
+
if (!returnType) {
|
|
12058
|
+
return;
|
|
12059
|
+
}
|
|
12013
12060
|
switch (returnType) {
|
|
12014
12061
|
case "NONEVALUE":
|
|
12015
12062
|
ctx.result = void 0;
|
|
@@ -12018,7 +12065,7 @@ var EndNode = class extends DELogicNode {
|
|
|
12018
12065
|
ctx.result = null;
|
|
12019
12066
|
break;
|
|
12020
12067
|
case "SRCVALUE":
|
|
12021
|
-
ctx.result = rawValue;
|
|
12068
|
+
ctx.result = ibiz.util.rawValue.format(rawValue);
|
|
12022
12069
|
break;
|
|
12023
12070
|
case "LOGICPARAM":
|
|
12024
12071
|
ctx.result = ctx.params[returnParamId];
|
|
@@ -12056,7 +12103,7 @@ function handleSrcVal(ctx, srcValParams) {
|
|
|
12056
12103
|
case "NONEVALUE":
|
|
12057
12104
|
return void 0;
|
|
12058
12105
|
case "SRCVALUE":
|
|
12059
|
-
return srcValue;
|
|
12106
|
+
return ibiz.util.rawValue.format(srcValue);
|
|
12060
12107
|
case "WEBCONTEXT":
|
|
12061
12108
|
case "VIEWPARAM":
|
|
12062
12109
|
value = ctx.viewParams;
|
|
@@ -12684,18 +12731,18 @@ var DEActionMethod = class extends Method {
|
|
|
12684
12731
|
if (!deLogic) {
|
|
12685
12732
|
throw new RuntimeModelError18(this.method, "\u7F3A\u5C11\u5B9E\u4F53\u5904\u7406\u903B\u8F91");
|
|
12686
12733
|
}
|
|
12687
|
-
return execDELogicAction(deLogic, context, data, params);
|
|
12734
|
+
return execDELogicAction(deLogic, context, data || {}, params || {});
|
|
12688
12735
|
}
|
|
12689
|
-
if (!this.isLocalMode) {
|
|
12736
|
+
if (data && !this.isLocalMode) {
|
|
12690
12737
|
data = await this.input.handle(context, data);
|
|
12691
12738
|
}
|
|
12692
|
-
if (!["READ", "GETDRAFT"].includes(this.method.actionMode)) {
|
|
12693
|
-
await execFieldLogics(this.entity, "change", context, data, params);
|
|
12739
|
+
if (data && !["READ", "GETDRAFT"].includes(this.method.actionMode)) {
|
|
12740
|
+
await execFieldLogics(this.entity, "change", context, data, params || {});
|
|
12694
12741
|
}
|
|
12695
12742
|
let result;
|
|
12696
12743
|
switch (this.method.codeName) {
|
|
12697
12744
|
case "Create":
|
|
12698
|
-
result = await this.create(context, data, params);
|
|
12745
|
+
result = await this.create(context, data, params || {});
|
|
12699
12746
|
break;
|
|
12700
12747
|
case "Get":
|
|
12701
12748
|
result = await this.get(context, params);
|
|
@@ -12727,14 +12774,20 @@ var DEActionMethod = class extends Method {
|
|
|
12727
12774
|
default: {
|
|
12728
12775
|
let path2 = this.calcPath(context);
|
|
12729
12776
|
if (this.method.needResourceKey) {
|
|
12730
|
-
path2 = "".concat(path2, "/").concat(context[this.entity.codeName.toLowerCase()] || data[this.entity.keyAppDEFieldId]);
|
|
12777
|
+
path2 = "".concat(path2, "/").concat(context[this.entity.codeName.toLowerCase()] || (data == null ? void 0 : data[this.entity.keyAppDEFieldId]));
|
|
12731
12778
|
}
|
|
12732
12779
|
const res = await this.request(path2, context, data, params);
|
|
12733
12780
|
res.data = await this.result.handle(context, res.data);
|
|
12734
12781
|
result = res;
|
|
12735
12782
|
}
|
|
12736
12783
|
}
|
|
12737
|
-
await execFieldLogics(
|
|
12784
|
+
await execFieldLogics(
|
|
12785
|
+
this.entity,
|
|
12786
|
+
"compute",
|
|
12787
|
+
context,
|
|
12788
|
+
result.data,
|
|
12789
|
+
params || {}
|
|
12790
|
+
);
|
|
12738
12791
|
return result;
|
|
12739
12792
|
}
|
|
12740
12793
|
/**
|
|
@@ -13213,7 +13266,7 @@ var DEService = class {
|
|
|
13213
13266
|
* @param {IParams} [params2={}] 查询参数
|
|
13214
13267
|
* @return {*} {Promise<IHttpResponse>}
|
|
13215
13268
|
*/
|
|
13216
|
-
exec(id, context, params
|
|
13269
|
+
exec(id, context, params, params2) {
|
|
13217
13270
|
const method = this.getMethod(id);
|
|
13218
13271
|
if (method) {
|
|
13219
13272
|
return method.exec(context, params, params2);
|
|
@@ -13452,7 +13505,7 @@ var ControlService = class {
|
|
|
13452
13505
|
* @param {IParams} [params={}] 视图参数或数据
|
|
13453
13506
|
* @returns {*} {Promise<IHttpResponse>}
|
|
13454
13507
|
*/
|
|
13455
|
-
async exec(methodName, context, data
|
|
13508
|
+
async exec(methodName, context, data, params) {
|
|
13456
13509
|
const res = await this.app.deService.exec(
|
|
13457
13510
|
this.model.appDataEntityId,
|
|
13458
13511
|
methodName,
|
|
@@ -13488,7 +13541,7 @@ var ControlService = class {
|
|
|
13488
13541
|
|
|
13489
13542
|
// src/service/service/control/md-control.service.ts
|
|
13490
13543
|
import { RuntimeError as RuntimeError15 } from "@ibiz-template/core";
|
|
13491
|
-
import { isArray as
|
|
13544
|
+
import { isArray as isArray3 } from "qx-util";
|
|
13492
13545
|
var MDControlService = class extends ControlService {
|
|
13493
13546
|
/**
|
|
13494
13547
|
* 执行查询多条数据的方法
|
|
@@ -13620,7 +13673,7 @@ var MDControlService = class extends ControlService {
|
|
|
13620
13673
|
}
|
|
13621
13674
|
}
|
|
13622
13675
|
if (res.ok) {
|
|
13623
|
-
if (
|
|
13676
|
+
if (isArray3(res.data)) {
|
|
13624
13677
|
res.data = res.data.map((item) => this.toUIData(item));
|
|
13625
13678
|
} else {
|
|
13626
13679
|
res.data = this.toUIData(res.data);
|
|
@@ -14493,9 +14546,9 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
|
|
|
14493
14546
|
})(PanelNotifyState || {});
|
|
14494
14547
|
|
|
14495
14548
|
// src/controller/common/view/view.controller.ts
|
|
14496
|
-
import { createUUID as
|
|
14497
|
-
import { IBizContext as IBizContext2, RuntimeError as
|
|
14498
|
-
import { isEmpty as isEmpty8, isNil as
|
|
14549
|
+
import { createUUID as createUUID3, notNilEmpty as notNilEmpty6 } from "qx-util";
|
|
14550
|
+
import { IBizContext as IBizContext2, RuntimeError as RuntimeError23 } from "@ibiz-template/core";
|
|
14551
|
+
import { isEmpty as isEmpty8, isNil as isNil13, isNotNil as isNotNil3 } from "ramda";
|
|
14499
14552
|
|
|
14500
14553
|
// src/controller/utils/loading/loading.state.ts
|
|
14501
14554
|
import { NOOP } from "@ibiz-template/core";
|
|
@@ -15214,6 +15267,60 @@ var ValueExUtil = class {
|
|
|
15214
15267
|
}
|
|
15215
15268
|
};
|
|
15216
15269
|
|
|
15270
|
+
// src/controller/utils/value-default/value-default.ts
|
|
15271
|
+
import { RuntimeError as RuntimeError22, ModelError as ModelError16 } from "@ibiz-template/core";
|
|
15272
|
+
import dayjs from "dayjs";
|
|
15273
|
+
import { createUUID as createUUID2 } from "qx-util";
|
|
15274
|
+
import { isNil as isNil12, isNotNil as isNotNil2 } from "ramda";
|
|
15275
|
+
function getDefaultValue(opts, origins) {
|
|
15276
|
+
var _a;
|
|
15277
|
+
const { name, valueType, defaultValue, valueFormat } = opts;
|
|
15278
|
+
const { data, context, params } = origins;
|
|
15279
|
+
if (isNil12(valueType) && isNil12(defaultValue)) {
|
|
15280
|
+
return;
|
|
15281
|
+
}
|
|
15282
|
+
if (valueType === "RESET") {
|
|
15283
|
+
return null;
|
|
15284
|
+
}
|
|
15285
|
+
const value = data[name];
|
|
15286
|
+
if (isNotNil2(value)) {
|
|
15287
|
+
return;
|
|
15288
|
+
}
|
|
15289
|
+
if (!valueType && defaultValue) {
|
|
15290
|
+
return defaultValue;
|
|
15291
|
+
}
|
|
15292
|
+
switch (valueType) {
|
|
15293
|
+
case "APPDATA":
|
|
15294
|
+
if (Object.prototype.hasOwnProperty.call(params, defaultValue)) {
|
|
15295
|
+
return params[defaultValue];
|
|
15296
|
+
}
|
|
15297
|
+
if (Object.prototype.hasOwnProperty.call(context, defaultValue)) {
|
|
15298
|
+
return context[defaultValue];
|
|
15299
|
+
}
|
|
15300
|
+
break;
|
|
15301
|
+
case "OPERATORNAME":
|
|
15302
|
+
return context.srfusername;
|
|
15303
|
+
case "OPERATOR":
|
|
15304
|
+
return context.srfuserid;
|
|
15305
|
+
case "CURTIME":
|
|
15306
|
+
return dayjs().format(valueFormat);
|
|
15307
|
+
case "PARAM":
|
|
15308
|
+
return data[defaultValue];
|
|
15309
|
+
case "SESSION":
|
|
15310
|
+
case "APPLICATION":
|
|
15311
|
+
if (!((_a = ibiz.appData) == null ? void 0 : _a.context)) {
|
|
15312
|
+
throw new RuntimeError22("appdata.context\u4E0D\u5B58\u5728");
|
|
15313
|
+
}
|
|
15314
|
+
return ibiz.appData.context[defaultValue];
|
|
15315
|
+
case "CONTEXT":
|
|
15316
|
+
return params[defaultValue];
|
|
15317
|
+
case "UNIQUEID":
|
|
15318
|
+
return createUUID2();
|
|
15319
|
+
default:
|
|
15320
|
+
throw new ModelError16({}, "\u9ED8\u8BA4\u503C\u7C7B\u578B[".concat(valueType, "]\u672A\u652F\u6301"));
|
|
15321
|
+
}
|
|
15322
|
+
}
|
|
15323
|
+
|
|
15217
15324
|
// src/controller/common/base.controller.ts
|
|
15218
15325
|
var SELF_KEY = "__self";
|
|
15219
15326
|
var BaseController = class {
|
|
@@ -15559,7 +15666,7 @@ var ViewController = class extends BaseController {
|
|
|
15559
15666
|
async onCreated() {
|
|
15560
15667
|
await super.onCreated();
|
|
15561
15668
|
this.modal.hooks.beforeDismiss.tapPromise(async (modalData) => {
|
|
15562
|
-
if (
|
|
15669
|
+
if (isNotNil3(this.state.closeOK)) {
|
|
15563
15670
|
modalData.ok = this.state.closeOK;
|
|
15564
15671
|
}
|
|
15565
15672
|
await this._evt.emit("onCloseView", { ...modalData });
|
|
@@ -15629,8 +15736,8 @@ var ViewController = class extends BaseController {
|
|
|
15629
15736
|
*/
|
|
15630
15737
|
handleContextParams() {
|
|
15631
15738
|
this.context.srfappid = this.model.appId;
|
|
15632
|
-
if (
|
|
15633
|
-
this.context.srfsessionid =
|
|
15739
|
+
if (isNil13(this.context.srfsessionid) || isEmpty8(this.context.srfsessionid)) {
|
|
15740
|
+
this.context.srfsessionid = createUUID3();
|
|
15634
15741
|
}
|
|
15635
15742
|
const navContexts = this.model.appViewNavContexts;
|
|
15636
15743
|
let context = {};
|
|
@@ -15661,7 +15768,7 @@ var ViewController = class extends BaseController {
|
|
|
15661
15768
|
async callUIAction(key, args) {
|
|
15662
15769
|
const result = this.call(key, args);
|
|
15663
15770
|
if (result === void 0) {
|
|
15664
|
-
throw new
|
|
15771
|
+
throw new RuntimeError23("\u6CA1\u6709\u5F15\u64CE\u652F\u6301\u9884\u7F6E\u754C\u9762\u884C\u4E3A".concat(key));
|
|
15665
15772
|
}
|
|
15666
15773
|
return result;
|
|
15667
15774
|
}
|
|
@@ -15892,7 +15999,7 @@ var CodeListEditorController = class extends EditorController {
|
|
|
15892
15999
|
|
|
15893
16000
|
// src/controller/common/control/control.controller.ts
|
|
15894
16001
|
import { NoticeError } from "@ibiz-template/core";
|
|
15895
|
-
import { isNil as
|
|
16002
|
+
import { isNil as isNil14 } from "ramda";
|
|
15896
16003
|
var ControlController = class extends BaseController {
|
|
15897
16004
|
/**
|
|
15898
16005
|
* Creates an instance of ControlController.
|
|
@@ -16069,7 +16176,7 @@ var ControlController = class extends BaseController {
|
|
|
16069
16176
|
let message;
|
|
16070
16177
|
let duration;
|
|
16071
16178
|
if (msgItem && msgItem.content) {
|
|
16072
|
-
duration =
|
|
16179
|
+
duration = isNil14(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
|
|
16073
16180
|
const scriptParams = { ...this.getEventArgs() };
|
|
16074
16181
|
if (opts == null ? void 0 : opts.data) {
|
|
16075
16182
|
scriptParams.data = opts.data;
|
|
@@ -16108,7 +16215,7 @@ var ControlController = class extends BaseController {
|
|
|
16108
16215
|
};
|
|
16109
16216
|
|
|
16110
16217
|
// src/controller/common/control/md-control.controller.ts
|
|
16111
|
-
import { isElementSame, RuntimeError as
|
|
16218
|
+
import { isElementSame, RuntimeError as RuntimeError24 } from "@ibiz-template/core";
|
|
16112
16219
|
var MDControlController = class extends ControlController {
|
|
16113
16220
|
constructor() {
|
|
16114
16221
|
super(...arguments);
|
|
@@ -16151,6 +16258,12 @@ var MDControlController = class extends ControlController {
|
|
|
16151
16258
|
ibiz.mc.command.change.on(this.onDataChange);
|
|
16152
16259
|
this.setSort();
|
|
16153
16260
|
}
|
|
16261
|
+
async onMounted() {
|
|
16262
|
+
await super.onMounted();
|
|
16263
|
+
if (this.state.loadDefault) {
|
|
16264
|
+
this.load({ isInitialLoad: true });
|
|
16265
|
+
}
|
|
16266
|
+
}
|
|
16154
16267
|
onDestroyed() {
|
|
16155
16268
|
ibiz.mc.command.change.off(this.onDataChange);
|
|
16156
16269
|
return super.onDestroyed();
|
|
@@ -16284,7 +16397,7 @@ var MDControlController = class extends ControlController {
|
|
|
16284
16397
|
async remove(args) {
|
|
16285
16398
|
const { context, params, data } = this.handlerAbilityParams(args);
|
|
16286
16399
|
if (!(data == null ? void 0 : data.length)) {
|
|
16287
|
-
throw new
|
|
16400
|
+
throw new RuntimeError24("\u672A\u9009\u4E2D\u6570\u636E");
|
|
16288
16401
|
}
|
|
16289
16402
|
if ((args == null ? void 0 : args.silent) !== true) {
|
|
16290
16403
|
const del = await ibiz.confirm.error({
|
|
@@ -16428,7 +16541,7 @@ var MDControlController = class extends ControlController {
|
|
|
16428
16541
|
// src/controller/control/app-menu/app-menu.controller.ts
|
|
16429
16542
|
import {
|
|
16430
16543
|
findRecursiveChild,
|
|
16431
|
-
RuntimeError as
|
|
16544
|
+
RuntimeError as RuntimeError25,
|
|
16432
16545
|
RuntimeModelError as RuntimeModelError21
|
|
16433
16546
|
} from "@ibiz-template/core";
|
|
16434
16547
|
var AppMenuController = class extends ControlController {
|
|
@@ -16468,7 +16581,7 @@ var AppMenuController = class extends ControlController {
|
|
|
16468
16581
|
childrenFields: ["appMenuItems"]
|
|
16469
16582
|
});
|
|
16470
16583
|
if (!menuItem) {
|
|
16471
|
-
throw new
|
|
16584
|
+
throw new RuntimeError25("\u627E\u4E0D\u5230\u540D\u4E3A".concat(id, "\u7684\u83DC\u5355\u9879"));
|
|
16472
16585
|
}
|
|
16473
16586
|
this.evt.emit("onClick", {
|
|
16474
16587
|
eventArg: id,
|
|
@@ -16558,7 +16671,7 @@ var AppMenuController = class extends ControlController {
|
|
|
16558
16671
|
// src/controller/control/app-menu-icon-view/app-menu-icon-view.controller.ts
|
|
16559
16672
|
import {
|
|
16560
16673
|
findRecursiveChild as findRecursiveChild2,
|
|
16561
|
-
RuntimeError as
|
|
16674
|
+
RuntimeError as RuntimeError26,
|
|
16562
16675
|
RuntimeModelError as RuntimeModelError22
|
|
16563
16676
|
} from "@ibiz-template/core";
|
|
16564
16677
|
var AppMenuIconViewController = class extends AppMenuController {
|
|
@@ -16568,7 +16681,7 @@ var AppMenuIconViewController = class extends AppMenuController {
|
|
|
16568
16681
|
childrenFields: ["appMenuItems"]
|
|
16569
16682
|
});
|
|
16570
16683
|
if (!menuItem) {
|
|
16571
|
-
throw new
|
|
16684
|
+
throw new RuntimeError26("\u627E\u4E0D\u5230\u540D\u4E3A".concat(id, "\u7684\u83DC\u5355\u9879"));
|
|
16572
16685
|
}
|
|
16573
16686
|
this.evt.emit("onClick", {
|
|
16574
16687
|
eventArg: id,
|
|
@@ -16593,10 +16706,10 @@ var AppMenuIconViewController = class extends AppMenuController {
|
|
|
16593
16706
|
};
|
|
16594
16707
|
|
|
16595
16708
|
// src/controller/control/calendar/calendar.controller.ts
|
|
16596
|
-
import
|
|
16709
|
+
import dayjs2 from "dayjs";
|
|
16597
16710
|
|
|
16598
16711
|
// src/controller/control/calendar/calendar.service.ts
|
|
16599
|
-
import { RuntimeError as
|
|
16712
|
+
import { RuntimeError as RuntimeError27 } from "@ibiz-template/core";
|
|
16600
16713
|
var CalendarService = class extends MDControlService {
|
|
16601
16714
|
/**
|
|
16602
16715
|
* 执行查询多条数据的方法
|
|
@@ -16646,11 +16759,11 @@ var CalendarService = class extends MDControlService {
|
|
|
16646
16759
|
setCalendarConfigData(items, index) {
|
|
16647
16760
|
const { sysCalendarItems } = this.model;
|
|
16648
16761
|
if (!sysCalendarItems) {
|
|
16649
|
-
throw new
|
|
16762
|
+
throw new RuntimeError27("\u672A\u627E\u5230\u65E5\u5386\u9879\u6A21\u578B");
|
|
16650
16763
|
}
|
|
16651
16764
|
const calendarItem = sysCalendarItems[index];
|
|
16652
16765
|
if (!calendarItem) {
|
|
16653
|
-
throw new
|
|
16766
|
+
throw new RuntimeError27("\u672A\u627E\u5230\u65E5\u5386\u9879\u6A21\u578B");
|
|
16654
16767
|
}
|
|
16655
16768
|
return items.map((item) => {
|
|
16656
16769
|
return new CalendarItemData(calendarItem, item);
|
|
@@ -16763,8 +16876,8 @@ var CalendarController = class extends MDControlController {
|
|
|
16763
16876
|
1
|
|
16764
16877
|
);
|
|
16765
16878
|
return {
|
|
16766
|
-
start:
|
|
16767
|
-
end:
|
|
16879
|
+
start: dayjs2(firstDayOfMonth).format("YYYY-MM-DD HH:mm:ss"),
|
|
16880
|
+
end: dayjs2(lastDayOfMonth).format("YYYY-MM-DD HH:mm:ss")
|
|
16768
16881
|
};
|
|
16769
16882
|
}
|
|
16770
16883
|
return { start, end };
|
|
@@ -16840,29 +16953,29 @@ var CalendarController = class extends MDControlController {
|
|
|
16840
16953
|
};
|
|
16841
16954
|
|
|
16842
16955
|
// src/controller/control/chart/chart.controller.ts
|
|
16843
|
-
import { RuntimeError as
|
|
16956
|
+
import { RuntimeError as RuntimeError29 } from "@ibiz-template/core";
|
|
16844
16957
|
|
|
16845
16958
|
// src/controller/control/chart/generator/chart-options-generator.ts
|
|
16846
16959
|
import { mergeDeepRight as mergeDeepRight3 } from "ramda";
|
|
16847
|
-
import { RuntimeError as
|
|
16960
|
+
import { RuntimeError as RuntimeError28 } from "@ibiz-template/core";
|
|
16848
16961
|
|
|
16849
16962
|
// src/controller/control/chart/generator/line-series-generator.ts
|
|
16850
16963
|
import { RuntimeModelError as RuntimeModelError24 } from "@ibiz-template/core";
|
|
16851
16964
|
|
|
16852
16965
|
// src/controller/control/chart/generator/base-series-generator.ts
|
|
16853
16966
|
import { RuntimeModelError as RuntimeModelError23, toNumberOrNil } from "@ibiz-template/core";
|
|
16854
|
-
import
|
|
16967
|
+
import dayjs3 from "dayjs";
|
|
16855
16968
|
import minMax from "dayjs/plugin/minMax";
|
|
16856
16969
|
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
16857
16970
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
16858
16971
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
16859
16972
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
16860
|
-
import { clone as clone11, isNil as
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16973
|
+
import { clone as clone11, isNil as isNil15, mergeDeepRight } from "ramda";
|
|
16974
|
+
dayjs3.extend(minMax);
|
|
16975
|
+
dayjs3.extend(isSameOrBefore);
|
|
16976
|
+
dayjs3.extend(quarterOfYear);
|
|
16977
|
+
dayjs3.extend(weekOfYear);
|
|
16978
|
+
dayjs3.extend(isoWeek);
|
|
16866
16979
|
var DEFAULT_GROUP = "$default_group";
|
|
16867
16980
|
var BaseSeriesGenerator = class {
|
|
16868
16981
|
/**
|
|
@@ -16946,10 +17059,10 @@ var BaseSeriesGenerator = class {
|
|
|
16946
17059
|
* @return {*} {(string | undefined)}
|
|
16947
17060
|
*/
|
|
16948
17061
|
translateVal(codeListKey, val, isExclude = false) {
|
|
16949
|
-
if (
|
|
17062
|
+
if (isNil15(val)) {
|
|
16950
17063
|
return void 0;
|
|
16951
17064
|
}
|
|
16952
|
-
if (
|
|
17065
|
+
if (isNil15(codeListKey)) {
|
|
16953
17066
|
return val;
|
|
16954
17067
|
}
|
|
16955
17068
|
const codeListItems = this.chartGenerator.codeListMap.get(codeListKey);
|
|
@@ -16979,7 +17092,7 @@ var BaseSeriesGenerator = class {
|
|
|
16979
17092
|
seriesCodeListId,
|
|
16980
17093
|
item[this.groupField]
|
|
16981
17094
|
);
|
|
16982
|
-
if (
|
|
17095
|
+
if (isNil15(groupVal)) {
|
|
16983
17096
|
return;
|
|
16984
17097
|
}
|
|
16985
17098
|
group = groupVal;
|
|
@@ -17095,25 +17208,25 @@ var BaseSeriesGenerator = class {
|
|
|
17095
17208
|
format = "YYYY-MM";
|
|
17096
17209
|
}
|
|
17097
17210
|
if (singleData[this.catalogField]) {
|
|
17098
|
-
const formattedDate =
|
|
17211
|
+
const formattedDate = dayjs3(singleData[this.catalogField]).format(
|
|
17099
17212
|
format
|
|
17100
17213
|
);
|
|
17101
17214
|
singleData[this.catalogField] = formattedDate;
|
|
17102
17215
|
}
|
|
17103
17216
|
} else if (groupMode === "QUARTER") {
|
|
17104
17217
|
if (singleData[this.catalogField]) {
|
|
17105
|
-
const formattedDate = "".concat(
|
|
17218
|
+
const formattedDate = "".concat(dayjs3(
|
|
17106
17219
|
singleData[this.catalogField]
|
|
17107
|
-
).format("YYYY"), "-").concat(
|
|
17220
|
+
).format("YYYY"), "-").concat(dayjs3(
|
|
17108
17221
|
singleData[this.catalogField]
|
|
17109
17222
|
).quarter());
|
|
17110
17223
|
singleData[this.catalogField] = formattedDate;
|
|
17111
17224
|
}
|
|
17112
17225
|
} else if (groupMode === "YEARWEEK") {
|
|
17113
17226
|
if (singleData[this.catalogField]) {
|
|
17114
|
-
const formattedDate = "".concat(
|
|
17227
|
+
const formattedDate = "".concat(dayjs3(
|
|
17115
17228
|
singleData[this.catalogField]
|
|
17116
|
-
).format("YYYY"), "-").concat(
|
|
17229
|
+
).format("YYYY"), "-").concat(dayjs3(singleData[this.catalogField]).week());
|
|
17117
17230
|
singleData[this.catalogField] = formattedDate;
|
|
17118
17231
|
}
|
|
17119
17232
|
}
|
|
@@ -17135,7 +17248,7 @@ var BaseSeriesGenerator = class {
|
|
|
17135
17248
|
let sortedKeys = [];
|
|
17136
17249
|
if (groupMode === "DAY" || groupMode === "YEAR" || groupMode === "MONTH") {
|
|
17137
17250
|
sortedKeys = Array.from(dateMap.keys()).sort(
|
|
17138
|
-
(a, b) =>
|
|
17251
|
+
(a, b) => dayjs3(a).diff(dayjs3(b))
|
|
17139
17252
|
);
|
|
17140
17253
|
} else if (groupMode === "QUARTER" || groupMode === "YEARWEEK") {
|
|
17141
17254
|
sortedKeys = Array.from(dateMap.keys()).sort((a, b) => {
|
|
@@ -17169,11 +17282,11 @@ var BaseSeriesGenerator = class {
|
|
|
17169
17282
|
const dates = [];
|
|
17170
17283
|
Object.keys(data).forEach((key) => {
|
|
17171
17284
|
data[key].forEach((_val, date) => {
|
|
17172
|
-
dates.push(
|
|
17285
|
+
dates.push(dayjs3(date));
|
|
17173
17286
|
});
|
|
17174
17287
|
});
|
|
17175
|
-
const maxDate =
|
|
17176
|
-
const minDate =
|
|
17288
|
+
const maxDate = dayjs3.max(dates);
|
|
17289
|
+
const minDate = dayjs3.min(dates);
|
|
17177
17290
|
if (groupMode === "DAY") {
|
|
17178
17291
|
let currentDate = minDate;
|
|
17179
17292
|
const endDate = maxDate;
|
|
@@ -17255,7 +17368,7 @@ var BaseSeriesGenerator = class {
|
|
|
17255
17368
|
const [minYear] = minYearWeek.split("-");
|
|
17256
17369
|
const [maxYear] = maxYearWeek.split("-");
|
|
17257
17370
|
for (let year = parseInt(minYear, 10); year <= parseInt(maxYear, 10); year++) {
|
|
17258
|
-
const numWeeks =
|
|
17371
|
+
const numWeeks = dayjs3("".concat(year, "-12-31")).isoWeek();
|
|
17259
17372
|
for (let week = 1; week <= numWeeks; week++) {
|
|
17260
17373
|
const yearWeek = "".concat(year, "-").concat(week);
|
|
17261
17374
|
Object.keys(data).forEach((key) => {
|
|
@@ -17780,7 +17893,7 @@ var ChartOptionsGenerator2 = class {
|
|
|
17780
17893
|
getSrfkeyByParams(params) {
|
|
17781
17894
|
const generator = this.seriesGenerators[params.seriesIndex];
|
|
17782
17895
|
if (!generator) {
|
|
17783
|
-
throw new
|
|
17896
|
+
throw new RuntimeError28("\u627E\u4E0D\u5230".concat(params.seriesIndex, "\u5E8F\u5217\u7684generator\uFF01"));
|
|
17784
17897
|
}
|
|
17785
17898
|
return generator.getSrfkeyByParams(params);
|
|
17786
17899
|
}
|
|
@@ -17892,10 +18005,10 @@ var ChartController = class extends MDControlController {
|
|
|
17892
18005
|
*/
|
|
17893
18006
|
updateChart() {
|
|
17894
18007
|
if (!this.chart) {
|
|
17895
|
-
throw new
|
|
18008
|
+
throw new RuntimeError29("chart\u5BF9\u8C61\u6CA1\u6709\u6B63\u786E\u521D\u59CB\u5316");
|
|
17896
18009
|
}
|
|
17897
18010
|
if (!this.options) {
|
|
17898
|
-
throw new
|
|
18011
|
+
throw new RuntimeError29("options\u8FD8\u6CA1\u8BA1\u7B97");
|
|
17899
18012
|
}
|
|
17900
18013
|
this.chart.setOption(this.options);
|
|
17901
18014
|
this.resizeChart();
|
|
@@ -17944,16 +18057,16 @@ import { recursiveIterate } from "@ibiz-template/core";
|
|
|
17944
18057
|
|
|
17945
18058
|
// src/ui-action/provider/backend-ui-action-provider.ts
|
|
17946
18059
|
import { RuntimeModelError as RuntimeModelError44 } from "@ibiz-template/core";
|
|
17947
|
-
import { isArray as
|
|
18060
|
+
import { isArray as isArray4 } from "qx-util";
|
|
17948
18061
|
|
|
17949
18062
|
// src/ui-action/provider/ui-action-provider-base.ts
|
|
17950
18063
|
import { RuntimeModelError as RuntimeModelError43 } from "@ibiz-template/core";
|
|
17951
18064
|
|
|
17952
18065
|
// src/ui-logic/index.ts
|
|
17953
|
-
import { RuntimeError as
|
|
18066
|
+
import { RuntimeError as RuntimeError34 } from "@ibiz-template/core";
|
|
17954
18067
|
|
|
17955
18068
|
// src/ui-logic/ui-logic.ts
|
|
17956
|
-
import { ModelError as
|
|
18069
|
+
import { ModelError as ModelError24, RuntimeModelError as RuntimeModelError42 } from "@ibiz-template/core";
|
|
17957
18070
|
|
|
17958
18071
|
// src/ui-logic/ui-logic-context.ts
|
|
17959
18072
|
var UILogicContext = class {
|
|
@@ -18079,7 +18192,7 @@ var UILogicContext = class {
|
|
|
18079
18192
|
import { RuntimeModelError as RuntimeModelError29 } from "@ibiz-template/core";
|
|
18080
18193
|
|
|
18081
18194
|
// src/ui-logic/ui-logic-link/ui-logic-link.ts
|
|
18082
|
-
import { ModelError as
|
|
18195
|
+
import { ModelError as ModelError18 } from "@ibiz-template/core";
|
|
18083
18196
|
|
|
18084
18197
|
// src/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.ts
|
|
18085
18198
|
import { RuntimeModelError as RuntimeModelError28 } from "@ibiz-template/core";
|
|
@@ -18089,7 +18202,7 @@ var UILogicLinkCond = class {
|
|
|
18089
18202
|
};
|
|
18090
18203
|
|
|
18091
18204
|
// src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts
|
|
18092
|
-
import { ModelError as
|
|
18205
|
+
import { ModelError as ModelError17, RuntimeModelError as RuntimeModelError27 } from "@ibiz-template/core";
|
|
18093
18206
|
var UILogicLinkSingleCond = class extends UILogicLinkCond {
|
|
18094
18207
|
constructor(model) {
|
|
18095
18208
|
super();
|
|
@@ -18143,7 +18256,7 @@ var UILogicLinkSingleCond = class extends UILogicLinkCond {
|
|
|
18143
18256
|
return testCond(dst[this.dstField], this.op, src[this.value]);
|
|
18144
18257
|
}
|
|
18145
18258
|
case "CURTIME":
|
|
18146
|
-
throw new
|
|
18259
|
+
throw new ModelError17(this.model, "\u6682\u672A\u652F\u6301\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u5F53\u524D\u65F6\u95F4]");
|
|
18147
18260
|
default:
|
|
18148
18261
|
return testCond(dst[this.dstField], this.op, this.value);
|
|
18149
18262
|
}
|
|
@@ -18285,13 +18398,13 @@ var UILogicLink = class {
|
|
|
18285
18398
|
case 1:
|
|
18286
18399
|
return true;
|
|
18287
18400
|
case 2:
|
|
18288
|
-
throw new
|
|
18401
|
+
throw new ModelError18(this.model, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8FDE\u63A5\u7C7B\u578B: \u5F02\u6B65\u7ED3\u675F");
|
|
18289
18402
|
case 3:
|
|
18290
|
-
throw new
|
|
18403
|
+
throw new ModelError18(this.model, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8FDE\u63A5\u7C7B\u578B: \u5F02\u6B65\u62D2\u7EDD");
|
|
18291
18404
|
case 9:
|
|
18292
|
-
throw new
|
|
18405
|
+
throw new ModelError18(this.model, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8FDE\u63A5\u7C7B\u578B: \u5F02\u5E38\u5904\u7406");
|
|
18293
18406
|
default:
|
|
18294
|
-
throw new
|
|
18407
|
+
throw new ModelError18(this.model, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8FDE\u63A5\u7C7B\u578B:".concat(linkMode));
|
|
18295
18408
|
}
|
|
18296
18409
|
}
|
|
18297
18410
|
};
|
|
@@ -18375,11 +18488,14 @@ var StartNode2 = class extends UILogicNode {
|
|
|
18375
18488
|
};
|
|
18376
18489
|
|
|
18377
18490
|
// src/ui-logic/ui-logic-node/end-node/end-node.ts
|
|
18378
|
-
import { ModelError as
|
|
18491
|
+
import { ModelError as ModelError19 } from "@ibiz-template/core";
|
|
18379
18492
|
var EndNode2 = class extends UILogicNode {
|
|
18380
18493
|
async exec(ctx) {
|
|
18381
18494
|
ctx.isEndNode = true;
|
|
18382
18495
|
const { returnType, rawValue, returnParamId } = this.model;
|
|
18496
|
+
if (!returnType) {
|
|
18497
|
+
return;
|
|
18498
|
+
}
|
|
18383
18499
|
switch (returnType) {
|
|
18384
18500
|
case "NONEVALUE":
|
|
18385
18501
|
ctx.result = void 0;
|
|
@@ -18388,7 +18504,7 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18388
18504
|
ctx.result = null;
|
|
18389
18505
|
break;
|
|
18390
18506
|
case "SRCVALUE":
|
|
18391
|
-
ctx.result = rawValue;
|
|
18507
|
+
ctx.result = ibiz.util.rawValue.format(rawValue);
|
|
18392
18508
|
break;
|
|
18393
18509
|
case "LOGICPARAM":
|
|
18394
18510
|
ctx.result = ctx.params[returnParamId];
|
|
@@ -18396,7 +18512,7 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18396
18512
|
case "LOGICPARAMFIELD":
|
|
18397
18513
|
case "BREAK":
|
|
18398
18514
|
default:
|
|
18399
|
-
throw new
|
|
18515
|
+
throw new ModelError19(
|
|
18400
18516
|
this.model,
|
|
18401
18517
|
"\u6682\u672A\u652F\u6301\u7684\u7ED3\u675F\u8282\u70B9\u8FD4\u56DE\u503C\u7C7B\u578B: ".concat(returnType)
|
|
18402
18518
|
);
|
|
@@ -18405,11 +18521,11 @@ var EndNode2 = class extends UILogicNode {
|
|
|
18405
18521
|
};
|
|
18406
18522
|
|
|
18407
18523
|
// src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
|
|
18408
|
-
import { ModelError as
|
|
18524
|
+
import { ModelError as ModelError21 } from "@ibiz-template/core";
|
|
18409
18525
|
import { clone as clone13 } from "ramda";
|
|
18410
18526
|
|
|
18411
18527
|
// src/ui-logic/utils/handle-src-val.ts
|
|
18412
|
-
import { ModelError as
|
|
18528
|
+
import { ModelError as ModelError20 } from "@ibiz-template/core";
|
|
18413
18529
|
import { clone as clone12 } from "ramda";
|
|
18414
18530
|
function handleSrcVal2(ctx, srcValParams) {
|
|
18415
18531
|
const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
@@ -18424,7 +18540,7 @@ function handleSrcVal2(ctx, srcValParams) {
|
|
|
18424
18540
|
case "NONEVALUE":
|
|
18425
18541
|
return void 0;
|
|
18426
18542
|
case "SRCVALUE":
|
|
18427
|
-
return srcValue;
|
|
18543
|
+
return ibiz.util.rawValue.format(srcValue);
|
|
18428
18544
|
case "WEBCONTEXT":
|
|
18429
18545
|
case "VIEWPARAM":
|
|
18430
18546
|
value = ctx.viewParams;
|
|
@@ -18439,7 +18555,7 @@ function handleSrcVal2(ctx, srcValParams) {
|
|
|
18439
18555
|
value = clone12(ibiz.env);
|
|
18440
18556
|
break;
|
|
18441
18557
|
default:
|
|
18442
|
-
throw new
|
|
18558
|
+
throw new ModelError20(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
|
|
18443
18559
|
}
|
|
18444
18560
|
const srcField = srcFieldName;
|
|
18445
18561
|
if (value && srcField) {
|
|
@@ -18479,7 +18595,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
18479
18595
|
await this.sortParam(nodeParam, ctx);
|
|
18480
18596
|
break;
|
|
18481
18597
|
default:
|
|
18482
|
-
throw new
|
|
18598
|
+
throw new ModelError21(
|
|
18483
18599
|
nodeParam,
|
|
18484
18600
|
"\u6682\u672A\u652F\u6301\u903B\u8F91\u5904\u7406\u53C2\u6570\u64CD\u4F5C".concat(nodeParam.paramAction)
|
|
18485
18601
|
);
|
|
@@ -18593,7 +18709,7 @@ var PrepareJSParamNode = class extends UILogicNode {
|
|
|
18593
18709
|
};
|
|
18594
18710
|
|
|
18595
18711
|
// src/ui-logic/ui-logic-node/view-ctrl-invoke-node/view-ctrl-invoke-node.ts
|
|
18596
|
-
import { RuntimeError as
|
|
18712
|
+
import { RuntimeError as RuntimeError30, RuntimeModelError as RuntimeModelError31 } from "@ibiz-template/core";
|
|
18597
18713
|
import { isFunction } from "lodash-es";
|
|
18598
18714
|
var ViewCtrlInvokeNode = class extends UILogicNode {
|
|
18599
18715
|
async exec(ctx) {
|
|
@@ -18610,14 +18726,14 @@ var ViewCtrlInvokeNode = class extends UILogicNode {
|
|
|
18610
18726
|
}
|
|
18611
18727
|
const invokeParam = ctx.params[invokeParamId];
|
|
18612
18728
|
if (!invokeParam) {
|
|
18613
|
-
throw new
|
|
18729
|
+
throw new RuntimeError30("\u6CA1\u6709\u627E\u5230\u64CD\u4F5C\u53C2\u6570".concat(invokeParamId));
|
|
18614
18730
|
}
|
|
18615
18731
|
const invokeCtrl = ctx.params[invokeCtrlId];
|
|
18616
18732
|
if (!invokeCtrl) {
|
|
18617
|
-
throw new
|
|
18733
|
+
throw new RuntimeError30("\u6CA1\u6709\u627E\u5230\u754C\u9762\u5BF9\u8C61".concat(invokeCtrlId));
|
|
18618
18734
|
}
|
|
18619
18735
|
if (!invokeCtrl[invokeMethod] || !isFunction(invokeCtrl[invokeMethod])) {
|
|
18620
|
-
throw new
|
|
18736
|
+
throw new RuntimeError30("\u6CA1\u6709\u627E\u5230\u8C03\u7528\u65B9\u6CD5".concat(invokeMethod));
|
|
18621
18737
|
}
|
|
18622
18738
|
await invokeCtrl[invokeMethod](invokeParam);
|
|
18623
18739
|
}
|
|
@@ -18640,7 +18756,7 @@ var BindParamNode2 = class extends UILogicNode {
|
|
|
18640
18756
|
};
|
|
18641
18757
|
|
|
18642
18758
|
// src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts
|
|
18643
|
-
import { ModelError as
|
|
18759
|
+
import { ModelError as ModelError22, RuntimeModelError as RuntimeModelError33 } from "@ibiz-template/core";
|
|
18644
18760
|
var MsgBoxNode = class extends UILogicNode {
|
|
18645
18761
|
constructor() {
|
|
18646
18762
|
super(...arguments);
|
|
@@ -18699,7 +18815,7 @@ var MsgBoxNode = class extends UILogicNode {
|
|
|
18699
18815
|
resultTags = ["ok", "cancel"];
|
|
18700
18816
|
break;
|
|
18701
18817
|
default:
|
|
18702
|
-
throw new
|
|
18818
|
+
throw new ModelError22(this.model, "".concat(buttonsType, "\u6682\u672A\u652F\u6301"));
|
|
18703
18819
|
}
|
|
18704
18820
|
const result = await ibiz.modal.confirm(modalParams);
|
|
18705
18821
|
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
@@ -18830,16 +18946,16 @@ var DataSetNode2 = class extends UILogicNode {
|
|
|
18830
18946
|
};
|
|
18831
18947
|
|
|
18832
18948
|
// src/ui-logic/ui-logic-node/throw-exception-node/throw-exception-node.ts
|
|
18833
|
-
import { RuntimeError as
|
|
18949
|
+
import { RuntimeError as RuntimeError31 } from "@ibiz-template/core";
|
|
18834
18950
|
var ThrowExceptionNode2 = class extends UILogicNode {
|
|
18835
18951
|
async exec(_ctx) {
|
|
18836
18952
|
const { errorInfo } = this.model;
|
|
18837
|
-
throw new
|
|
18953
|
+
throw new RuntimeError31(errorInfo);
|
|
18838
18954
|
}
|
|
18839
18955
|
};
|
|
18840
18956
|
|
|
18841
18957
|
// src/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.ts
|
|
18842
|
-
import { RuntimeError as
|
|
18958
|
+
import { RuntimeError as RuntimeError32, RuntimeModelError as RuntimeModelError40 } from "@ibiz-template/core";
|
|
18843
18959
|
var ViewCtrlFireEventNode = class extends UILogicNode {
|
|
18844
18960
|
async exec(ctx) {
|
|
18845
18961
|
ctx.isEndNode = true;
|
|
@@ -18855,18 +18971,18 @@ var ViewCtrlFireEventNode = class extends UILogicNode {
|
|
|
18855
18971
|
}
|
|
18856
18972
|
const invokeCtrl = ctx.params[fireCtrlId];
|
|
18857
18973
|
if (!invokeCtrl) {
|
|
18858
|
-
throw new
|
|
18974
|
+
throw new RuntimeError32("\u6CA1\u6709\u627E\u5230\u89E6\u53D1\u5BF9\u8C61".concat(fireCtrlId));
|
|
18859
18975
|
}
|
|
18860
18976
|
const eventParam = ctx.params[eventParamId];
|
|
18861
18977
|
if (!eventParam) {
|
|
18862
|
-
throw new
|
|
18978
|
+
throw new RuntimeError32("\u6CA1\u6709\u627E\u5230\u4E8B\u4EF6\u53C2\u6570\u5BF9\u8C61".concat(eventParamId));
|
|
18863
18979
|
}
|
|
18864
18980
|
await invokeCtrl.evt.emit(eventName, eventParam);
|
|
18865
18981
|
}
|
|
18866
18982
|
};
|
|
18867
18983
|
|
|
18868
18984
|
// src/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.ts
|
|
18869
|
-
import { RuntimeError as
|
|
18985
|
+
import { RuntimeError as RuntimeError33, RuntimeModelError as RuntimeModelError41 } from "@ibiz-template/core";
|
|
18870
18986
|
var ExecuteDELogicNode = class extends UILogicNode {
|
|
18871
18987
|
async exec(ctx) {
|
|
18872
18988
|
const {
|
|
@@ -18886,7 +19002,7 @@ var ExecuteDELogicNode = class extends UILogicNode {
|
|
|
18886
19002
|
}
|
|
18887
19003
|
const dstParam = ctx.params[dstDEUILogicParamId];
|
|
18888
19004
|
if (!dstParam) {
|
|
18889
|
-
throw new
|
|
19005
|
+
throw new RuntimeError33("\u6CA1\u6709\u627E\u5230\u4F20\u5165\u53C2\u6570".concat(dstDEUILogicParamId));
|
|
18890
19006
|
}
|
|
18891
19007
|
const result = await execDELogicById(
|
|
18892
19008
|
dstAppDELogicId,
|
|
@@ -18902,7 +19018,7 @@ var ExecuteDELogicNode = class extends UILogicNode {
|
|
|
18902
19018
|
};
|
|
18903
19019
|
|
|
18904
19020
|
// src/ui-logic/ui-logic-param/ui-logic-param.ts
|
|
18905
|
-
import { ModelError as
|
|
19021
|
+
import { ModelError as ModelError23 } from "@ibiz-template/core";
|
|
18906
19022
|
var UILogicParam = class {
|
|
18907
19023
|
/**
|
|
18908
19024
|
* Creates an instance of UILogicParam.
|
|
@@ -18948,7 +19064,7 @@ var UILogicParam = class {
|
|
|
18948
19064
|
} else if (m.entityListParam) {
|
|
18949
19065
|
ctx.params[tag] = [];
|
|
18950
19066
|
} else if (m.entityPageParam) {
|
|
18951
|
-
throw new
|
|
19067
|
+
throw new ModelError23(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u5206\u9875\u67E5\u8BE2\u7ED3\u679C");
|
|
18952
19068
|
} else if (m.entityParam) {
|
|
18953
19069
|
ctx.params[tag] = {};
|
|
18954
19070
|
} else if (m.lastReturnParam) {
|
|
@@ -18956,9 +19072,9 @@ var UILogicParam = class {
|
|
|
18956
19072
|
} else if (m.navContextParam) {
|
|
18957
19073
|
ctx.params[tag] = context;
|
|
18958
19074
|
} else if (m.navViewParamParam) {
|
|
18959
|
-
throw new
|
|
19075
|
+
throw new ModelError23(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u89C6\u56FE\u8DEF\u7531\u53C2\u6570");
|
|
18960
19076
|
} else if (m.routeViewSessionParam) {
|
|
18961
|
-
throw new
|
|
19077
|
+
throw new ModelError23(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u8DEF\u7531\u89C6\u56FE\u4F1A\u8BDD");
|
|
18962
19078
|
} else if (m.simpleListParam) {
|
|
18963
19079
|
ctx.params[tag] = [];
|
|
18964
19080
|
} else if (m.simpleParam) {
|
|
@@ -18966,7 +19082,7 @@ var UILogicParam = class {
|
|
|
18966
19082
|
} else if (m.viewNavDataParam) {
|
|
18967
19083
|
ctx.params[tag] = viewParams;
|
|
18968
19084
|
} else if (m.viewSessionParam) {
|
|
18969
|
-
throw new
|
|
19085
|
+
throw new ModelError23(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B: \u5F53\u524D\u89C6\u56FE\u4F1A\u8BDD");
|
|
18970
19086
|
}
|
|
18971
19087
|
}
|
|
18972
19088
|
/**
|
|
@@ -18983,7 +19099,7 @@ var UILogicParam = class {
|
|
|
18983
19099
|
} else if (m.simpleParam || m.entityParam) {
|
|
18984
19100
|
ctx.params[tag] = {};
|
|
18985
19101
|
} else {
|
|
18986
|
-
throw new
|
|
19102
|
+
throw new ModelError23(m, "\u672A\u652F\u6301\u7684\u903B\u8F91\u53C2\u6570\u7C7B\u578B\u91CD\u65B0\u5EFA\u7ACB\u53D8\u91CF");
|
|
18987
19103
|
}
|
|
18988
19104
|
}
|
|
18989
19105
|
};
|
|
@@ -19080,7 +19196,7 @@ var UILogic = class {
|
|
|
19080
19196
|
break;
|
|
19081
19197
|
case "PFPLUGIN":
|
|
19082
19198
|
default:
|
|
19083
|
-
throw new
|
|
19199
|
+
throw new ModelError24(node, "\u672A\u652F\u6301\u7684\u903B\u8F91\u8282\u70B9\u7C7B\u578B: ".concat(logicNodeType));
|
|
19084
19200
|
}
|
|
19085
19201
|
this.nodes.set(node.id, logicNode);
|
|
19086
19202
|
});
|
|
@@ -19179,7 +19295,7 @@ async function execUILogic(deUILogicId, appDataEntityId, parameters) {
|
|
|
19179
19295
|
const app = ibiz.hub.getApp(parameters.context.srfappid);
|
|
19180
19296
|
const deUILogic = await app.getDEUILogic(deUILogicId, appDataEntityId);
|
|
19181
19297
|
if (!deUILogic) {
|
|
19182
|
-
throw new
|
|
19298
|
+
throw new RuntimeError34(
|
|
19183
19299
|
"\u627E\u4E0D\u5230\u5B9E\u4F53".concat(appDataEntityId, "\u7684\u754C\u9762\u903B\u8F91").concat(deUILogicId)
|
|
19184
19300
|
);
|
|
19185
19301
|
}
|
|
@@ -19192,7 +19308,7 @@ async function execUILogic(deUILogicId, appDataEntityId, parameters) {
|
|
|
19192
19308
|
}
|
|
19193
19309
|
|
|
19194
19310
|
// src/ui-action/uiaction-util.ts
|
|
19195
|
-
import { RuntimeError as
|
|
19311
|
+
import { RuntimeError as RuntimeError35 } from "@ibiz-template/core";
|
|
19196
19312
|
var UIActionUtil = class {
|
|
19197
19313
|
/**
|
|
19198
19314
|
* 执行界面行为
|
|
@@ -19207,7 +19323,7 @@ var UIActionUtil = class {
|
|
|
19207
19323
|
static async exec(actionId, params) {
|
|
19208
19324
|
const action = await getUIActionById(actionId);
|
|
19209
19325
|
if (!action) {
|
|
19210
|
-
throw new
|
|
19326
|
+
throw new RuntimeError35("\u6CA1\u627E\u5230".concat(actionId, "\u7684\u754C\u9762\u884C\u4E3A\u6A21\u578B"));
|
|
19211
19327
|
}
|
|
19212
19328
|
const provider = await getUIActionProvider(action);
|
|
19213
19329
|
return provider.exec(action, params);
|
|
@@ -19474,7 +19590,7 @@ var BackendUIActionProvider = class extends UIActionProviderBase {
|
|
|
19474
19590
|
ibiz.message.success(action.successMsg);
|
|
19475
19591
|
}
|
|
19476
19592
|
Object.assign(actionResult, {
|
|
19477
|
-
data:
|
|
19593
|
+
data: isArray4(res.data) ? res.data : [res.data],
|
|
19478
19594
|
nextContext: resultContext,
|
|
19479
19595
|
nextParams: tempParams
|
|
19480
19596
|
});
|
|
@@ -19536,7 +19652,7 @@ var SysUIActionProvider = class extends UIActionProviderBase {
|
|
|
19536
19652
|
};
|
|
19537
19653
|
|
|
19538
19654
|
// src/ui-action/provider/front-ui-action-provider.ts
|
|
19539
|
-
import { StringUtil, RuntimeModelError as RuntimeModelError45, ModelError as
|
|
19655
|
+
import { StringUtil, RuntimeModelError as RuntimeModelError45, ModelError as ModelError25 } from "@ibiz-template/core";
|
|
19540
19656
|
var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
19541
19657
|
async execAction(action, args) {
|
|
19542
19658
|
const { context, params, data, event, noWaitRoute } = args;
|
|
@@ -19580,7 +19696,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
19580
19696
|
actionResult = this.doOther(action, args);
|
|
19581
19697
|
break;
|
|
19582
19698
|
default:
|
|
19583
|
-
throw new
|
|
19699
|
+
throw new ModelError25(
|
|
19584
19700
|
action,
|
|
19585
19701
|
"\u672A\u652F\u6301\u7684\u524D\u53F0\u5904\u7406\u6A21\u5F0F[".concat(action.frontProcessType, "]")
|
|
19586
19702
|
);
|
|
@@ -20091,7 +20207,7 @@ var ViewPortletController = class extends PortletPartController {
|
|
|
20091
20207
|
|
|
20092
20208
|
// src/controller/control/data-view/data-view.controller.ts
|
|
20093
20209
|
import { RuntimeModelError as RuntimeModelError46 } from "@ibiz-template/core";
|
|
20094
|
-
import { isNil as
|
|
20210
|
+
import { isNil as isNil16 } from "ramda";
|
|
20095
20211
|
|
|
20096
20212
|
// src/controller/control/data-view/data-view.service.ts
|
|
20097
20213
|
var DataViewControlService = class extends MDControlService {
|
|
@@ -20123,6 +20239,16 @@ var DataViewControlService = class extends MDControlService {
|
|
|
20123
20239
|
|
|
20124
20240
|
// src/controller/control/data-view/data-view.controller.ts
|
|
20125
20241
|
var DataViewControlController = class extends MDControlController {
|
|
20242
|
+
/**
|
|
20243
|
+
* 是否允许新建
|
|
20244
|
+
* @author lxm
|
|
20245
|
+
* @date 2023-09-11 04:05:25
|
|
20246
|
+
* @readonly
|
|
20247
|
+
* @type {boolean}
|
|
20248
|
+
*/
|
|
20249
|
+
get enableNew() {
|
|
20250
|
+
return this.model.enableCardNew === true;
|
|
20251
|
+
}
|
|
20126
20252
|
/**
|
|
20127
20253
|
* 初始化State
|
|
20128
20254
|
*
|
|
@@ -20133,6 +20259,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
20133
20259
|
super.initState();
|
|
20134
20260
|
this.state.noSort = this.model.noSort === true;
|
|
20135
20261
|
this.state.size = this.model.pagingSize || 20;
|
|
20262
|
+
this.state.singleSelect = this.model.singleSelect === true;
|
|
20136
20263
|
}
|
|
20137
20264
|
/**
|
|
20138
20265
|
* 初始化
|
|
@@ -20156,6 +20283,92 @@ var DataViewControlController = class extends MDControlController {
|
|
|
20156
20283
|
this.service = new DataViewControlService(this.model);
|
|
20157
20284
|
await this.service.init(this.context);
|
|
20158
20285
|
}
|
|
20286
|
+
/**
|
|
20287
|
+
* 初始化分组右侧界面行为按钮的状态
|
|
20288
|
+
*
|
|
20289
|
+
* @author chitanda
|
|
20290
|
+
* @date 2023-08-02 17:08:04
|
|
20291
|
+
* @return {*} {Promise<void>}
|
|
20292
|
+
*/
|
|
20293
|
+
async initGroupActionStates() {
|
|
20294
|
+
var _a;
|
|
20295
|
+
const { groupUIActionGroup } = this.model;
|
|
20296
|
+
if (!((_a = groupUIActionGroup == null ? void 0 : groupUIActionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
|
|
20297
|
+
return;
|
|
20298
|
+
}
|
|
20299
|
+
this.state.groups.forEach(async (group) => {
|
|
20300
|
+
const containerState = new ButtonContainerState();
|
|
20301
|
+
groupUIActionGroup.uiactionGroupDetails.forEach((detail) => {
|
|
20302
|
+
const actionid = detail.uiactionId;
|
|
20303
|
+
if (actionid) {
|
|
20304
|
+
const buttonState = new UIActionButtonState(
|
|
20305
|
+
detail.id,
|
|
20306
|
+
this.context.srfappid,
|
|
20307
|
+
actionid
|
|
20308
|
+
);
|
|
20309
|
+
containerState.addState(detail.id, buttonState);
|
|
20310
|
+
}
|
|
20311
|
+
});
|
|
20312
|
+
await containerState.update();
|
|
20313
|
+
group.groupActionGroupState = containerState;
|
|
20314
|
+
});
|
|
20315
|
+
}
|
|
20316
|
+
/**
|
|
20317
|
+
* 行单击事件
|
|
20318
|
+
*
|
|
20319
|
+
* @author lxm
|
|
20320
|
+
* @date 2022-08-18 22:08:16
|
|
20321
|
+
* @param {IData} data 选中的单条数据
|
|
20322
|
+
*/
|
|
20323
|
+
async onRowClick(data) {
|
|
20324
|
+
super.onRowClick(data);
|
|
20325
|
+
const { groupAppDEFieldId } = this.model;
|
|
20326
|
+
if (groupAppDEFieldId) {
|
|
20327
|
+
this.state.groups.forEach((group) => {
|
|
20328
|
+
group.selectedData = [];
|
|
20329
|
+
});
|
|
20330
|
+
this.state.selectedData.forEach((select) => {
|
|
20331
|
+
const groupVal = select[groupAppDEFieldId];
|
|
20332
|
+
const selectGroup = this.state.groups.find(
|
|
20333
|
+
(group) => group.key === groupVal
|
|
20334
|
+
);
|
|
20335
|
+
if (selectGroup) {
|
|
20336
|
+
selectGroup.selectedData.push(select);
|
|
20337
|
+
}
|
|
20338
|
+
});
|
|
20339
|
+
if (this.state.singleSelect) {
|
|
20340
|
+
this.state.groups.forEach((group) => {
|
|
20341
|
+
let tempData = data;
|
|
20342
|
+
if (group.selectedData.indexOf(tempData) !== -1) {
|
|
20343
|
+
if (tempData && tempData instanceof ControlVO) {
|
|
20344
|
+
tempData = tempData.getOrigin();
|
|
20345
|
+
}
|
|
20346
|
+
if (tempData) {
|
|
20347
|
+
group.groupActionGroupState.update(
|
|
20348
|
+
tempData,
|
|
20349
|
+
this.model.appDataEntityId
|
|
20350
|
+
);
|
|
20351
|
+
}
|
|
20352
|
+
} else {
|
|
20353
|
+
group.groupActionGroupState.update(
|
|
20354
|
+
void 0,
|
|
20355
|
+
this.model.appDataEntityId
|
|
20356
|
+
);
|
|
20357
|
+
}
|
|
20358
|
+
});
|
|
20359
|
+
} else {
|
|
20360
|
+
const actionGroup = this.state.groups.find((group) => {
|
|
20361
|
+
return group.children.indexOf(data) !== -1;
|
|
20362
|
+
});
|
|
20363
|
+
if (actionGroup) {
|
|
20364
|
+
actionGroup.groupActionGroupState.update(
|
|
20365
|
+
actionGroup.selectedData[0],
|
|
20366
|
+
this.model.appDataEntityId
|
|
20367
|
+
);
|
|
20368
|
+
}
|
|
20369
|
+
}
|
|
20370
|
+
}
|
|
20371
|
+
}
|
|
20159
20372
|
/**
|
|
20160
20373
|
* 加载更多
|
|
20161
20374
|
*
|
|
@@ -20169,6 +20382,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
20169
20382
|
}
|
|
20170
20383
|
async afterLoad(args, items) {
|
|
20171
20384
|
await this.handleDataGroup();
|
|
20385
|
+
await this.initGroupActionStates();
|
|
20172
20386
|
return items;
|
|
20173
20387
|
}
|
|
20174
20388
|
/**
|
|
@@ -20272,7 +20486,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
20272
20486
|
const groupMap = /* @__PURE__ */ new Map();
|
|
20273
20487
|
items.forEach((item) => {
|
|
20274
20488
|
const groupVal = item[groupAppDEFieldId];
|
|
20275
|
-
if (
|
|
20489
|
+
if (isNil16(groupVal)) {
|
|
20276
20490
|
return;
|
|
20277
20491
|
}
|
|
20278
20492
|
if (!groupMap.has(groupVal)) {
|
|
@@ -20366,13 +20580,49 @@ var DataViewControlController = class extends MDControlController {
|
|
|
20366
20580
|
}
|
|
20367
20581
|
}
|
|
20368
20582
|
}
|
|
20583
|
+
/**
|
|
20584
|
+
* 点击新建
|
|
20585
|
+
* @author lxm
|
|
20586
|
+
* @date 2023-09-11 07:22:33
|
|
20587
|
+
* @param {MouseEvent} event
|
|
20588
|
+
* @param {(string | number)} group 分组标识
|
|
20589
|
+
*/
|
|
20590
|
+
onClickNew(event, group) {
|
|
20591
|
+
const params = { ...this.params, srfgroup: group };
|
|
20592
|
+
UIActionUtil.execAndResolved("new", {
|
|
20593
|
+
context: this.context,
|
|
20594
|
+
params,
|
|
20595
|
+
data: [],
|
|
20596
|
+
view: this.view,
|
|
20597
|
+
event
|
|
20598
|
+
});
|
|
20599
|
+
}
|
|
20600
|
+
/**
|
|
20601
|
+
* 分组工具栏点击处理回调
|
|
20602
|
+
* @author lxm
|
|
20603
|
+
* @date 2023-09-11 04:48:06
|
|
20604
|
+
* @param {IUIActionGroupDetail} detail
|
|
20605
|
+
* @param {MouseEvent} event
|
|
20606
|
+
* @return {*} {Promise<void>}
|
|
20607
|
+
*/
|
|
20608
|
+
async onGroupToolbarClick(detail, event, group) {
|
|
20609
|
+
const actionId = detail.uiactionId;
|
|
20610
|
+
const params = { ...this.params, srfgroup: group.key };
|
|
20611
|
+
await UIActionUtil.execAndResolved(actionId, {
|
|
20612
|
+
context: this.context,
|
|
20613
|
+
params,
|
|
20614
|
+
data: group.selectedData || [],
|
|
20615
|
+
view: this.view,
|
|
20616
|
+
event
|
|
20617
|
+
});
|
|
20618
|
+
}
|
|
20369
20619
|
};
|
|
20370
20620
|
|
|
20371
20621
|
// src/controller/control/exp-bar/calendar-exp-bar.controller.ts
|
|
20372
20622
|
import { RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
|
|
20373
20623
|
|
|
20374
20624
|
// src/controller/control/exp-bar/exp-bar.controller.ts
|
|
20375
|
-
import { RuntimeError as
|
|
20625
|
+
import { RuntimeError as RuntimeError36, RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
|
|
20376
20626
|
var ExpBarControlController = class extends ControlController {
|
|
20377
20627
|
constructor() {
|
|
20378
20628
|
super(...arguments);
|
|
@@ -20534,6 +20784,9 @@ var ExpBarControlController = class extends ControlController {
|
|
|
20534
20784
|
);
|
|
20535
20785
|
});
|
|
20536
20786
|
}
|
|
20787
|
+
if (this.state.loadDefault) {
|
|
20788
|
+
this.load();
|
|
20789
|
+
}
|
|
20537
20790
|
}
|
|
20538
20791
|
/**
|
|
20539
20792
|
* 多数据部件加载成功 设置默认选中
|
|
@@ -20563,7 +20816,6 @@ var ExpBarControlController = class extends ControlController {
|
|
|
20563
20816
|
(item) => item[this.navKeyName] === this.state.srfnav
|
|
20564
20817
|
);
|
|
20565
20818
|
const routeAndHasSub = this.routeDepth && window.location.hash.split("/").length > this.routeDepth * 2 + 2;
|
|
20566
|
-
console.log("routeAndHasSub", routeAndHasSub);
|
|
20567
20819
|
if (routeAndHasSub) {
|
|
20568
20820
|
if (selectItem) {
|
|
20569
20821
|
this.xDataController.setSelection([selectItem]);
|
|
@@ -20658,7 +20910,7 @@ var ExpBarControlController = class extends ControlController {
|
|
|
20658
20910
|
if (["GRID", "DATAVIEW", "LIST"].includes(((_a = this.XDataModel) == null ? void 0 : _a.controlType) || "")) {
|
|
20659
20911
|
return this.XDataModel.navAppViewId;
|
|
20660
20912
|
}
|
|
20661
|
-
throw new
|
|
20913
|
+
throw new RuntimeError36("\u591A\u8282\u70B9\u89C6\u56FE\u7531\u5B50\u7C7B\u5B9E\u73B0");
|
|
20662
20914
|
}
|
|
20663
20915
|
/**
|
|
20664
20916
|
* 获取导航视图
|
|
@@ -20800,7 +21052,7 @@ var CalendarExpBarController = class extends ExpBarControlController {
|
|
|
20800
21052
|
};
|
|
20801
21053
|
|
|
20802
21054
|
// src/controller/control/exp-bar/tree-exp-bar.controller.ts
|
|
20803
|
-
import { RuntimeError as
|
|
21055
|
+
import { RuntimeError as RuntimeError37, RuntimeModelError as RuntimeModelError49 } from "@ibiz-template/core";
|
|
20804
21056
|
var TreeExpBarController = class extends ExpBarControlController {
|
|
20805
21057
|
constructor() {
|
|
20806
21058
|
super(...arguments);
|
|
@@ -20875,7 +21127,7 @@ var TreeExpBarController = class extends ExpBarControlController {
|
|
|
20875
21127
|
const deData = node.deData || node;
|
|
20876
21128
|
const nodeModel = this.getNodeModel(node.nodeId);
|
|
20877
21129
|
if (!nodeModel) {
|
|
20878
|
-
throw new
|
|
21130
|
+
throw new RuntimeError37("\u627E\u4E0D\u5230".concat(node.nodeId, "\u7684\u8282\u70B9\u6A21\u578B"));
|
|
20879
21131
|
}
|
|
20880
21132
|
const result = this.prepareParams(nodeModel, deData, context, params);
|
|
20881
21133
|
result.context.currentSrfNav = nodeId;
|
|
@@ -21188,6 +21440,12 @@ var SearchFormController = class extends FormController {
|
|
|
21188
21440
|
await this.service.init(this.context);
|
|
21189
21441
|
await this.load();
|
|
21190
21442
|
}
|
|
21443
|
+
async onMounted() {
|
|
21444
|
+
await super.onMounted();
|
|
21445
|
+
if (this.state.loadDefault) {
|
|
21446
|
+
this.load();
|
|
21447
|
+
}
|
|
21448
|
+
}
|
|
21191
21449
|
/**
|
|
21192
21450
|
* 加载草稿
|
|
21193
21451
|
*
|
|
@@ -21614,7 +21872,7 @@ var FormButtonController = class extends FormDetailController {
|
|
|
21614
21872
|
|
|
21615
21873
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts
|
|
21616
21874
|
import { isOverlap as isOverlap2 } from "@ibiz-template/core";
|
|
21617
|
-
import { createUUID as
|
|
21875
|
+
import { createUUID as createUUID4, notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
21618
21876
|
|
|
21619
21877
|
// src/controller/control/form/form-detail/form-druipart/form-druipart.state.ts
|
|
21620
21878
|
var FormDruipartState = class extends FormDetailState {
|
|
@@ -21727,7 +21985,7 @@ var FormDRUIPartController = class extends FormDetailController {
|
|
|
21727
21985
|
this.form.context
|
|
21728
21986
|
);
|
|
21729
21987
|
if (!this.state.viewComponentKey) {
|
|
21730
|
-
this.state.viewComponentKey =
|
|
21988
|
+
this.state.viewComponentKey = createUUID4();
|
|
21731
21989
|
this.navContext = newContext;
|
|
21732
21990
|
this.navParams = newParams;
|
|
21733
21991
|
} else if (JSON.stringify(this.navContext) !== JSON.stringify(newContext) || JSON.stringify(this.navParams) !== JSON.stringify(newParams)) {
|
|
@@ -21878,9 +22136,7 @@ var FormGroupPanelController = class extends FormDetailController {
|
|
|
21878
22136
|
|
|
21879
22137
|
// src/controller/control/form/form-detail/form-item/form-item.controller.ts
|
|
21880
22138
|
import Schema from "async-validator";
|
|
21881
|
-
import {
|
|
21882
|
-
import { ModelError as ModelError25, RuntimeError as RuntimeError37 } from "@ibiz-template/core";
|
|
21883
|
-
import dayjs3 from "dayjs";
|
|
22139
|
+
import { isNilOrEmpty as isNilOrEmpty6 } from "qx-util";
|
|
21884
22140
|
|
|
21885
22141
|
// src/controller/control/form/form-detail/form-item/form-item.state.ts
|
|
21886
22142
|
var FormItemState = class extends FormDetailState {
|
|
@@ -22153,60 +22409,20 @@ var FormItemController = class extends FormDetailController {
|
|
|
22153
22409
|
* @param {boolean} isCreate 新建默认值还是更新默认值
|
|
22154
22410
|
*/
|
|
22155
22411
|
setDefaultValue(isCreate, data = this.data) {
|
|
22156
|
-
var _a;
|
|
22157
22412
|
const { createDVT, createDV, updateDVT, updateDV } = this.model;
|
|
22158
22413
|
const valueType = isCreate ? createDVT : updateDVT;
|
|
22159
22414
|
const defaultValue = isCreate ? createDV : updateDV;
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
data[this.name] = defaultValue;
|
|
22172
|
-
return;
|
|
22173
|
-
}
|
|
22174
|
-
switch (valueType) {
|
|
22175
|
-
case "APPDATA":
|
|
22176
|
-
if (Object.prototype.hasOwnProperty.call(this.params, defaultValue)) {
|
|
22177
|
-
data[this.name] = this.params[defaultValue];
|
|
22178
|
-
}
|
|
22179
|
-
if (Object.prototype.hasOwnProperty.call(this.context, defaultValue)) {
|
|
22180
|
-
data[this.name] = this.context[defaultValue];
|
|
22181
|
-
}
|
|
22182
|
-
break;
|
|
22183
|
-
case "OPERATORNAME":
|
|
22184
|
-
data[this.name] = this.context.srfusername;
|
|
22185
|
-
break;
|
|
22186
|
-
case "OPERATOR":
|
|
22187
|
-
data[this.name] = this.context.srfuserid;
|
|
22188
|
-
break;
|
|
22189
|
-
case "CURTIME":
|
|
22190
|
-
data[this.name] = dayjs3().format(this.model.valueFormat);
|
|
22191
|
-
break;
|
|
22192
|
-
case "PARAM":
|
|
22193
|
-
data[this.name] = this.data[defaultValue];
|
|
22194
|
-
break;
|
|
22195
|
-
case "SESSION":
|
|
22196
|
-
case "APPLICATION":
|
|
22197
|
-
if (!((_a = ibiz.appData) == null ? void 0 : _a.context)) {
|
|
22198
|
-
throw new RuntimeError37("appdata.context\u4E0D\u5B58\u5728");
|
|
22199
|
-
}
|
|
22200
|
-
data[this.name] = ibiz.appData.context[defaultValue];
|
|
22201
|
-
break;
|
|
22202
|
-
case "CONTEXT":
|
|
22203
|
-
data[this.name] = this.params[defaultValue];
|
|
22204
|
-
break;
|
|
22205
|
-
case "UNIQUEID":
|
|
22206
|
-
data[this.name] = createUUID4();
|
|
22207
|
-
break;
|
|
22208
|
-
default:
|
|
22209
|
-
throw new ModelError25(this.model, "\u9ED8\u8BA4\u503C\u7C7B\u578B[".concat(valueType, "]\u672A\u652F\u6301"));
|
|
22415
|
+
const defaultVal = getDefaultValue(
|
|
22416
|
+
{
|
|
22417
|
+
name: this.name,
|
|
22418
|
+
valueType,
|
|
22419
|
+
defaultValue,
|
|
22420
|
+
valueFormat: this.model.valueFormat
|
|
22421
|
+
},
|
|
22422
|
+
{ data, context: this.context, params: this.params }
|
|
22423
|
+
);
|
|
22424
|
+
if (defaultVal !== void 0) {
|
|
22425
|
+
data[this.name] = defaultVal;
|
|
22210
22426
|
}
|
|
22211
22427
|
}
|
|
22212
22428
|
};
|
|
@@ -22439,7 +22655,7 @@ var FormMDCtrlDataViewController = class extends FormMDCtrlControlController {
|
|
|
22439
22655
|
|
|
22440
22656
|
// src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.ts
|
|
22441
22657
|
import { mergeInLeft as mergeInLeft2 } from "@ibiz-template/core";
|
|
22442
|
-
import { isArray as
|
|
22658
|
+
import { isArray as isArray5 } from "lodash-es";
|
|
22443
22659
|
|
|
22444
22660
|
// src/controller/control/form/edit-form/edit-form.controller.ts
|
|
22445
22661
|
import {
|
|
@@ -22746,6 +22962,12 @@ var EditFormController = class extends FormController {
|
|
|
22746
22962
|
trailing: true
|
|
22747
22963
|
});
|
|
22748
22964
|
}
|
|
22965
|
+
async onMounted() {
|
|
22966
|
+
await super.onMounted();
|
|
22967
|
+
if (this.state.loadDefault) {
|
|
22968
|
+
this.load();
|
|
22969
|
+
}
|
|
22970
|
+
}
|
|
22749
22971
|
/**
|
|
22750
22972
|
* 加载草稿行为
|
|
22751
22973
|
* @author lxm
|
|
@@ -23133,7 +23355,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlControlController {
|
|
|
23133
23355
|
handleResponse(response) {
|
|
23134
23356
|
const res = response;
|
|
23135
23357
|
if (res.ok) {
|
|
23136
|
-
if (
|
|
23358
|
+
if (isArray5(res.data)) {
|
|
23137
23359
|
res.data = res.data.map(
|
|
23138
23360
|
(item) => this.service.toUIData(item)
|
|
23139
23361
|
);
|
|
@@ -24060,6 +24282,7 @@ var GridRowState = class {
|
|
|
24060
24282
|
import {
|
|
24061
24283
|
awaitTimeout as awaitTimeout2,
|
|
24062
24284
|
debounceAndAsyncMerge as debounceAndAsyncMerge2,
|
|
24285
|
+
mergeDefaultInLeft as mergeDefaultInLeft3,
|
|
24063
24286
|
recursiveIterate as recursiveIterate4,
|
|
24064
24287
|
RuntimeError as RuntimeError41,
|
|
24065
24288
|
RuntimeModelError as RuntimeModelError51
|
|
@@ -24436,21 +24659,26 @@ var GridController = class extends MDControlController {
|
|
|
24436
24659
|
if (editingRow) {
|
|
24437
24660
|
throw new RuntimeError41("\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u884C\u7F16\u8F91\u4E2D\u7684\u884C\u7684\u64CD\u4F5C");
|
|
24438
24661
|
}
|
|
24662
|
+
const queryParams = { ...this.params };
|
|
24663
|
+
const defaultData = this.calcDefaultValue({}, true);
|
|
24664
|
+
Object.assign(queryParams, defaultData);
|
|
24439
24665
|
let res;
|
|
24440
24666
|
try {
|
|
24441
|
-
res = await this.service.getDraft(this.context,
|
|
24667
|
+
res = await this.service.getDraft(this.context, queryParams);
|
|
24442
24668
|
} catch (error) {
|
|
24443
24669
|
this.actionNotification("GETDRAFTERROR", {
|
|
24444
24670
|
error
|
|
24445
24671
|
});
|
|
24446
24672
|
throw error;
|
|
24447
24673
|
}
|
|
24448
|
-
|
|
24449
|
-
|
|
24674
|
+
const draftData = res.data;
|
|
24675
|
+
mergeDefaultInLeft3(draftData, defaultData);
|
|
24676
|
+
this.state.items.unshift(draftData);
|
|
24677
|
+
const newRow = new GridRowState(draftData, this);
|
|
24450
24678
|
this.state.rows.unshift(newRow);
|
|
24451
24679
|
this.gridStateNotify(newRow, "DRAFT" /* DRAFT */);
|
|
24452
24680
|
this.switchRowEdit(this.state.rows[0], true);
|
|
24453
|
-
this.actionNotification("GETDRAFTSUCCESS", { data:
|
|
24681
|
+
this.actionNotification("GETDRAFTSUCCESS", { data: draftData });
|
|
24454
24682
|
}
|
|
24455
24683
|
/**
|
|
24456
24684
|
* 保存
|
|
@@ -24714,19 +24942,24 @@ var GridController = class extends MDControlController {
|
|
|
24714
24942
|
if (toState === false) {
|
|
24715
24943
|
if (isSave) {
|
|
24716
24944
|
await this.save(row.data);
|
|
24717
|
-
} else {
|
|
24718
|
-
|
|
24719
|
-
|
|
24720
|
-
|
|
24721
|
-
|
|
24722
|
-
|
|
24945
|
+
} else if (row.data.srfuf === 0 /* CREATE */) {
|
|
24946
|
+
row.showRowEdit = false;
|
|
24947
|
+
this.evt.emit("onRowEditChange", { row });
|
|
24948
|
+
return this.remove({ data: [row.data], silent: true });
|
|
24949
|
+
} else if (row.cacheData) {
|
|
24950
|
+
row.data = row.cacheData;
|
|
24951
|
+
delete row.cacheData;
|
|
24723
24952
|
}
|
|
24724
|
-
}
|
|
24725
|
-
if (toState === true) {
|
|
24953
|
+
} else {
|
|
24726
24954
|
const editingRow = this.state.rows.find((item) => item.showRowEdit);
|
|
24727
24955
|
if (editingRow) {
|
|
24728
24956
|
throw new RuntimeError41("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
|
|
24729
24957
|
}
|
|
24958
|
+
if (row.data.srfuf === 1 /* UPDATE */) {
|
|
24959
|
+
row.cacheData = clone15(row.data);
|
|
24960
|
+
const defaultVal = this.calcDefaultValue(row.data, false);
|
|
24961
|
+
Object.assign(row.data, defaultVal);
|
|
24962
|
+
}
|
|
24730
24963
|
}
|
|
24731
24964
|
row.showRowEdit = toState;
|
|
24732
24965
|
Object.values(this.editColumns).forEach((column) => {
|
|
@@ -24915,6 +25148,36 @@ var GridController = class extends MDControlController {
|
|
|
24915
25148
|
// 单元格是否自适应
|
|
24916
25149
|
});
|
|
24917
25150
|
}
|
|
25151
|
+
/**
|
|
25152
|
+
* 计算默认值并返回一个对象,对象里的属性就是要填充的默认值
|
|
25153
|
+
* 没有的属性就是不需要填充默认值的属性
|
|
25154
|
+
* @author lxm
|
|
25155
|
+
* @date 2023-09-18 04:01:06
|
|
25156
|
+
* @param {IData} data
|
|
25157
|
+
* @param {boolean} isCreate
|
|
25158
|
+
* @return {*} {IData}
|
|
25159
|
+
*/
|
|
25160
|
+
calcDefaultValue(data, isCreate) {
|
|
25161
|
+
const result = {};
|
|
25162
|
+
Object.values(this.editColumns).forEach((c) => {
|
|
25163
|
+
const { createDV, createDVT, updateDV, updateDVT } = c.editItem;
|
|
25164
|
+
const valueType = isCreate ? createDVT : updateDVT;
|
|
25165
|
+
const defaultValue = isCreate ? createDV : updateDV;
|
|
25166
|
+
const defaultVal = getDefaultValue(
|
|
25167
|
+
{
|
|
25168
|
+
name: c.fieldName,
|
|
25169
|
+
valueType,
|
|
25170
|
+
defaultValue,
|
|
25171
|
+
valueFormat: c.valueFormat
|
|
25172
|
+
},
|
|
25173
|
+
{ data, context: this.context, params: this.params }
|
|
25174
|
+
);
|
|
25175
|
+
if (defaultVal !== void 0) {
|
|
25176
|
+
result[c.fieldName] = defaultVal;
|
|
25177
|
+
}
|
|
25178
|
+
});
|
|
25179
|
+
return result;
|
|
25180
|
+
}
|
|
24918
25181
|
};
|
|
24919
25182
|
|
|
24920
25183
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
@@ -26328,6 +26591,23 @@ var SearchBarController = class extends ControlController {
|
|
|
26328
26591
|
|
|
26329
26592
|
// src/controller/control/tab-exp-panel/tab-exp-panel.controller.ts
|
|
26330
26593
|
var TabExpPanelController = class extends ControlController {
|
|
26594
|
+
constructor() {
|
|
26595
|
+
super(...arguments);
|
|
26596
|
+
/**
|
|
26597
|
+
* 是否显示文本
|
|
26598
|
+
* @return {*}
|
|
26599
|
+
* @author: zhujiamin
|
|
26600
|
+
* @Date: 2023-09-20 10:36:35
|
|
26601
|
+
*/
|
|
26602
|
+
this.isShowCaption = true;
|
|
26603
|
+
/**
|
|
26604
|
+
* 是否显示图标
|
|
26605
|
+
* @return {*}
|
|
26606
|
+
* @author: zhujiamin
|
|
26607
|
+
* @Date: 2023-09-20 10:36:46
|
|
26608
|
+
*/
|
|
26609
|
+
this.isShowIcon = false;
|
|
26610
|
+
}
|
|
26331
26611
|
/**
|
|
26332
26612
|
* 初始化state的属性
|
|
26333
26613
|
*
|
|
@@ -26350,6 +26630,7 @@ var TabExpPanelController = class extends ControlController {
|
|
|
26350
26630
|
await super.onCreated();
|
|
26351
26631
|
this.layoutPanel = this.view.layoutPanel;
|
|
26352
26632
|
this.initTabPages();
|
|
26633
|
+
this.initIconCaption();
|
|
26353
26634
|
}
|
|
26354
26635
|
/**
|
|
26355
26636
|
* 初始化分页数据
|
|
@@ -26363,7 +26644,8 @@ var TabExpPanelController = class extends ControlController {
|
|
|
26363
26644
|
tabPages.push({
|
|
26364
26645
|
caption: panel.caption,
|
|
26365
26646
|
tabTag: panel.id,
|
|
26366
|
-
class: panel.sysCss ? [panel.sysCss.cssName] : []
|
|
26647
|
+
class: panel.sysCss ? [panel.sysCss.cssName] : [],
|
|
26648
|
+
sysImage: panel.sysImage
|
|
26367
26649
|
});
|
|
26368
26650
|
});
|
|
26369
26651
|
this.state.tabPages = tabPages;
|
|
@@ -26371,6 +26653,31 @@ var TabExpPanelController = class extends ControlController {
|
|
|
26371
26653
|
this.initDefaultPage();
|
|
26372
26654
|
}
|
|
26373
26655
|
}
|
|
26656
|
+
/**
|
|
26657
|
+
* 初始化图标和文本显示
|
|
26658
|
+
*
|
|
26659
|
+
* @memberof TabExpPanelController
|
|
26660
|
+
*/
|
|
26661
|
+
initIconCaption() {
|
|
26662
|
+
if (this.params.showmode) {
|
|
26663
|
+
switch (this.params.showmode) {
|
|
26664
|
+
case "ICONANDSHORTWORD":
|
|
26665
|
+
this.isShowIcon = true;
|
|
26666
|
+
this.isShowCaption = true;
|
|
26667
|
+
break;
|
|
26668
|
+
case "ICON":
|
|
26669
|
+
this.isShowIcon = true;
|
|
26670
|
+
this.isShowCaption = false;
|
|
26671
|
+
break;
|
|
26672
|
+
case "SHORTWORD":
|
|
26673
|
+
this.isShowIcon = false;
|
|
26674
|
+
this.isShowCaption = true;
|
|
26675
|
+
break;
|
|
26676
|
+
default:
|
|
26677
|
+
break;
|
|
26678
|
+
}
|
|
26679
|
+
}
|
|
26680
|
+
}
|
|
26374
26681
|
/**
|
|
26375
26682
|
* 初始化默认分页
|
|
26376
26683
|
*
|
|
@@ -27529,7 +27836,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
27529
27836
|
|
|
27530
27837
|
// src/controller/control/kanban/kanban.controller.ts
|
|
27531
27838
|
import { RuntimeError as RuntimeError45, RuntimeModelError as RuntimeModelError53 } from "@ibiz-template/core";
|
|
27532
|
-
import { isNil as
|
|
27839
|
+
import { isNil as isNil17 } from "ramda";
|
|
27533
27840
|
|
|
27534
27841
|
// src/controller/control/kanban/kanban.service.ts
|
|
27535
27842
|
var KanbanService = class extends DataViewControlService {
|
|
@@ -27573,16 +27880,6 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27573
27880
|
get enableEditGroup() {
|
|
27574
27881
|
return this.model.enableCardEditGroup === true;
|
|
27575
27882
|
}
|
|
27576
|
-
/**
|
|
27577
|
-
* 是否允许新建
|
|
27578
|
-
* @author lxm
|
|
27579
|
-
* @date 2023-09-11 04:05:25
|
|
27580
|
-
* @readonly
|
|
27581
|
-
* @type {boolean}
|
|
27582
|
-
*/
|
|
27583
|
-
get enableNew() {
|
|
27584
|
-
return this.model.enableCardNew === true;
|
|
27585
|
-
}
|
|
27586
27883
|
async initControlService() {
|
|
27587
27884
|
this.service = new KanbanService(this.model);
|
|
27588
27885
|
await this.service.init(this.context);
|
|
@@ -27602,47 +27899,6 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27602
27899
|
*/
|
|
27603
27900
|
async onCreated() {
|
|
27604
27901
|
await super.onCreated();
|
|
27605
|
-
await this.initGroupActionStates();
|
|
27606
|
-
}
|
|
27607
|
-
/**
|
|
27608
|
-
* 初始化分组右侧界面行为按钮的状态
|
|
27609
|
-
*
|
|
27610
|
-
* @author chitanda
|
|
27611
|
-
* @date 2023-08-02 17:08:04
|
|
27612
|
-
* @return {*} {Promise<void>}
|
|
27613
|
-
*/
|
|
27614
|
-
async initGroupActionStates() {
|
|
27615
|
-
var _a;
|
|
27616
|
-
const { groupUIActionGroup } = this.model;
|
|
27617
|
-
if (!((_a = groupUIActionGroup == null ? void 0 : groupUIActionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
|
|
27618
|
-
return;
|
|
27619
|
-
}
|
|
27620
|
-
const containerState = new ButtonContainerState();
|
|
27621
|
-
groupUIActionGroup.uiactionGroupDetails.forEach((detail) => {
|
|
27622
|
-
const actionid = detail.uiactionId;
|
|
27623
|
-
if (actionid) {
|
|
27624
|
-
const buttonState = new UIActionButtonState(
|
|
27625
|
-
detail.id,
|
|
27626
|
-
this.context.srfappid,
|
|
27627
|
-
actionid
|
|
27628
|
-
);
|
|
27629
|
-
containerState.addState(detail.id, buttonState);
|
|
27630
|
-
}
|
|
27631
|
-
});
|
|
27632
|
-
await containerState.update();
|
|
27633
|
-
this.state.groupActionGroupState = containerState;
|
|
27634
|
-
this.evt.on("onSelectionChange", (event) => {
|
|
27635
|
-
let data = event.data[0];
|
|
27636
|
-
if (data && data instanceof ControlVO) {
|
|
27637
|
-
data = data.getOrigin();
|
|
27638
|
-
}
|
|
27639
|
-
if (data) {
|
|
27640
|
-
this.state.groupActionGroupState.update(
|
|
27641
|
-
data,
|
|
27642
|
-
this.model.appDataEntityId
|
|
27643
|
-
);
|
|
27644
|
-
}
|
|
27645
|
-
});
|
|
27646
27902
|
}
|
|
27647
27903
|
/**
|
|
27648
27904
|
* 本地排序items
|
|
@@ -27662,7 +27918,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27662
27918
|
const isAsc = minorSortDir === "ASC";
|
|
27663
27919
|
items.forEach((item) => {
|
|
27664
27920
|
const sortValue = item[sortField];
|
|
27665
|
-
if (
|
|
27921
|
+
if (isNil17(sortValue)) {
|
|
27666
27922
|
item[sortField] = 0;
|
|
27667
27923
|
} else {
|
|
27668
27924
|
const toNum = Number(sortValue);
|
|
@@ -27804,42 +28060,6 @@ var KanbanController = class extends DataViewControlController {
|
|
|
27804
28060
|
await this.afterLoad({}, this.state.items);
|
|
27805
28061
|
}
|
|
27806
28062
|
}
|
|
27807
|
-
/**
|
|
27808
|
-
* 点击新建
|
|
27809
|
-
* @author lxm
|
|
27810
|
-
* @date 2023-09-11 07:22:33
|
|
27811
|
-
* @param {MouseEvent} event
|
|
27812
|
-
* @param {(string | number)} group 分组标识
|
|
27813
|
-
*/
|
|
27814
|
-
onClickNew(event, group) {
|
|
27815
|
-
const params = { ...this.params, srfgroup: group };
|
|
27816
|
-
UIActionUtil.execAndResolved("new", {
|
|
27817
|
-
context: this.context,
|
|
27818
|
-
params,
|
|
27819
|
-
data: [],
|
|
27820
|
-
view: this.view,
|
|
27821
|
-
event
|
|
27822
|
-
});
|
|
27823
|
-
}
|
|
27824
|
-
/**
|
|
27825
|
-
* 分组工具栏点击处理回调
|
|
27826
|
-
* @author lxm
|
|
27827
|
-
* @date 2023-09-11 04:48:06
|
|
27828
|
-
* @param {IUIActionGroupDetail} detail
|
|
27829
|
-
* @param {MouseEvent} event
|
|
27830
|
-
* @return {*} {Promise<void>}
|
|
27831
|
-
*/
|
|
27832
|
-
async onGroupToolbarClick(detail, event, group) {
|
|
27833
|
-
const actionId = detail.uiactionId;
|
|
27834
|
-
const params = { ...this.params, srfgroup: group };
|
|
27835
|
-
await UIActionUtil.execAndResolved(actionId, {
|
|
27836
|
-
context: this.context,
|
|
27837
|
-
params,
|
|
27838
|
-
data: this.state.selectedData,
|
|
27839
|
-
view: this.view,
|
|
27840
|
-
event
|
|
27841
|
-
});
|
|
27842
|
-
}
|
|
27843
28063
|
};
|
|
27844
28064
|
|
|
27845
28065
|
// src/controller/hub.controller.ts
|
|
@@ -28455,6 +28675,12 @@ var MDViewEngine = class extends ViewEngineBase {
|
|
|
28455
28675
|
await super.onCreated();
|
|
28456
28676
|
const { childNames } = this.view;
|
|
28457
28677
|
childNames.push(this.xdataControlName, "searchform", "searchbar");
|
|
28678
|
+
if (this.xdataControlName) {
|
|
28679
|
+
if (!this.view.slotProps[this.xdataControlName]) {
|
|
28680
|
+
this.view.slotProps[this.xdataControlName] = {};
|
|
28681
|
+
}
|
|
28682
|
+
this.view.slotProps[this.xdataControlName].loadDefault = false;
|
|
28683
|
+
}
|
|
28458
28684
|
}
|
|
28459
28685
|
async onMounted() {
|
|
28460
28686
|
await super.onMounted();
|
|
@@ -28774,6 +29000,13 @@ var GlobalUtil = class {
|
|
|
28774
29000
|
* @date 2023-08-28 23:08:59
|
|
28775
29001
|
*/
|
|
28776
29002
|
this.hbs = new HandlebarsUtil();
|
|
29003
|
+
/**
|
|
29004
|
+
* 直接值工具
|
|
29005
|
+
*
|
|
29006
|
+
* @author zhujiamin
|
|
29007
|
+
* @date 2023-08-24 11:08:28
|
|
29008
|
+
*/
|
|
29009
|
+
this.rawValue = new RawValueUtil();
|
|
28777
29010
|
}
|
|
28778
29011
|
/**
|
|
28779
29012
|
* 显示应用级别的加载提示
|
|
@@ -29478,6 +29711,29 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
29478
29711
|
rest
|
|
29479
29712
|
);
|
|
29480
29713
|
}
|
|
29714
|
+
async calcOpenViewRef(appUILogic, parameters) {
|
|
29715
|
+
const appDataEntityId = parameters.view.model.appDataEntityId;
|
|
29716
|
+
const formTypeName = await getFormTypeFieldName(appDataEntityId);
|
|
29717
|
+
if (!formTypeName) {
|
|
29718
|
+
throw new RuntimeModelError56(
|
|
29719
|
+
appUILogic,
|
|
29720
|
+
"".concat(appDataEntityId, "\u5B9E\u4F53\u7F3A\u5C11\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027")
|
|
29721
|
+
);
|
|
29722
|
+
}
|
|
29723
|
+
const { data } = parameters;
|
|
29724
|
+
const formTypeValue = data[0][formTypeName];
|
|
29725
|
+
if (!formTypeValue) {
|
|
29726
|
+
throw new RuntimeModelError56(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
|
|
29727
|
+
}
|
|
29728
|
+
const openViewRefs = appUILogic.openDataAppViews;
|
|
29729
|
+
const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
|
|
29730
|
+
if (!findView) {
|
|
29731
|
+
throw new RuntimeError52(
|
|
29732
|
+
"\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
29733
|
+
);
|
|
29734
|
+
}
|
|
29735
|
+
return findView;
|
|
29736
|
+
}
|
|
29481
29737
|
/**
|
|
29482
29738
|
* 执行应用预置界面逻辑newdata
|
|
29483
29739
|
*
|
|
@@ -29492,7 +29748,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
29492
29748
|
*/
|
|
29493
29749
|
async executeNewDataAppUILogic(appUILogic, parameters) {
|
|
29494
29750
|
const { context, params, ...rest } = parameters;
|
|
29495
|
-
const { data } = parameters;
|
|
29751
|
+
const { data, view } = parameters;
|
|
29496
29752
|
const { enableWizardAdd, enableBatchAdd, batchAddOnly, newDataAppView } = appUILogic;
|
|
29497
29753
|
let newViewRef;
|
|
29498
29754
|
if (enableWizardAdd) {
|
|
@@ -29501,7 +29757,19 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
29501
29757
|
return { ok: false };
|
|
29502
29758
|
}
|
|
29503
29759
|
} else if (enableBatchAdd) {
|
|
29504
|
-
|
|
29760
|
+
const parentDeName = calcDeCodeNameById(
|
|
29761
|
+
view.parentView.model.appDataEntityId
|
|
29762
|
+
);
|
|
29763
|
+
const batchViews = appUILogic.batchAddAppViews;
|
|
29764
|
+
newViewRef = batchViews == null ? void 0 : batchViews.find((viewRef) => {
|
|
29765
|
+
return viewRef.refMode.toLowerCase() !== parentDeName;
|
|
29766
|
+
});
|
|
29767
|
+
if (!newViewRef) {
|
|
29768
|
+
throw new RuntimeModelError56(
|
|
29769
|
+
appUILogic,
|
|
29770
|
+
"\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
|
|
29771
|
+
);
|
|
29772
|
+
}
|
|
29505
29773
|
} else if (batchAddOnly) {
|
|
29506
29774
|
throw new ModelError30(appUILogic, "batchAddOnly\u6682\u672A\u652F\u6301");
|
|
29507
29775
|
} else {
|
|
@@ -29529,13 +29797,17 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
29529
29797
|
_data.srfkey = void 0;
|
|
29530
29798
|
tempParams = Object.assign(tempParams, _data.$origin);
|
|
29531
29799
|
}
|
|
29532
|
-
|
|
29800
|
+
const result = await ibiz.commands.execute(
|
|
29533
29801
|
OpenAppViewCommand.TAG,
|
|
29534
29802
|
newViewRef.refAppViewId,
|
|
29535
29803
|
tempContext,
|
|
29536
29804
|
tempParams,
|
|
29537
29805
|
rest
|
|
29538
29806
|
);
|
|
29807
|
+
if (enableBatchAdd && result.data) {
|
|
29808
|
+
await this.doBatchAdd(appUILogic, result.data, context, newViewRef);
|
|
29809
|
+
}
|
|
29810
|
+
return result;
|
|
29539
29811
|
}
|
|
29540
29812
|
/**
|
|
29541
29813
|
* 获取向导新建视图引用
|
|
@@ -29578,28 +29850,71 @@ var AppUILogicExecutor = class extends LogicExecutor {
|
|
|
29578
29850
|
}
|
|
29579
29851
|
return findView;
|
|
29580
29852
|
}
|
|
29581
|
-
|
|
29582
|
-
|
|
29583
|
-
|
|
29584
|
-
|
|
29585
|
-
|
|
29586
|
-
|
|
29587
|
-
|
|
29588
|
-
|
|
29589
|
-
|
|
29590
|
-
|
|
29591
|
-
|
|
29592
|
-
|
|
29593
|
-
|
|
29594
|
-
|
|
29595
|
-
|
|
29596
|
-
|
|
29597
|
-
|
|
29598
|
-
throw new RuntimeError52(
|
|
29599
|
-
"\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
|
|
29853
|
+
/**
|
|
29854
|
+
* 拿选中的数据做批添加新建
|
|
29855
|
+
* @author lxm
|
|
29856
|
+
* @date 2023-09-15 05:20:02
|
|
29857
|
+
* @protected
|
|
29858
|
+
* @param {IAppUIOpenDataLogic} appUILogic
|
|
29859
|
+
* @param {IData[]} selections
|
|
29860
|
+
* @param {IContext} context
|
|
29861
|
+
* @param {IAppUILogicRefViewBase} newViewRef
|
|
29862
|
+
* @return {*} {Promise<void>}
|
|
29863
|
+
*/
|
|
29864
|
+
async doBatchAdd(appUILogic, selections, context, newViewRef) {
|
|
29865
|
+
var _a;
|
|
29866
|
+
if (selections == null ? void 0 : selections.length) {
|
|
29867
|
+
const selfDe = await ibiz.hub.getAppDataEntity(
|
|
29868
|
+
appUILogic.appDataEntityId,
|
|
29869
|
+
context.srfappid
|
|
29600
29870
|
);
|
|
29871
|
+
const minorDERs = selfDe.minorAppDERSs;
|
|
29872
|
+
const pickParentDeName = newViewRef.refMode.toLowerCase();
|
|
29873
|
+
if (!minorDERs) {
|
|
29874
|
+
throw new RuntimeModelError56(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
|
|
29875
|
+
}
|
|
29876
|
+
let pickParentFieldName;
|
|
29877
|
+
minorDERs == null ? void 0 : minorDERs.forEach((item) => {
|
|
29878
|
+
const majorDeName = calcDeCodeNameById(item.majorAppDataEntityId);
|
|
29879
|
+
if (pickParentDeName === majorDeName) {
|
|
29880
|
+
pickParentFieldName = item.parentAppDEFieldId;
|
|
29881
|
+
}
|
|
29882
|
+
});
|
|
29883
|
+
const openViewKeyParam = (_a = newViewRef.navigateParams) == null ? void 0 : _a.find((navParam) => {
|
|
29884
|
+
return navParam.key === "keymapping";
|
|
29885
|
+
});
|
|
29886
|
+
let addData = [];
|
|
29887
|
+
if (openViewKeyParam) {
|
|
29888
|
+
const keyValuePairs = openViewKeyParam.value.split(";");
|
|
29889
|
+
const keyMapping = {};
|
|
29890
|
+
for (const pair of keyValuePairs) {
|
|
29891
|
+
const [sourceKey, targetKey] = pair.split(":");
|
|
29892
|
+
if (sourceKey && targetKey) {
|
|
29893
|
+
keyMapping[sourceKey] = targetKey;
|
|
29894
|
+
}
|
|
29895
|
+
}
|
|
29896
|
+
addData = selections.map((item) => {
|
|
29897
|
+
const tempData = {
|
|
29898
|
+
[pickParentFieldName]: item.srfkey
|
|
29899
|
+
};
|
|
29900
|
+
for (const key in keyMapping) {
|
|
29901
|
+
if (Object.prototype.hasOwnProperty.call(keyMapping, key)) {
|
|
29902
|
+
const targetKey = keyMapping[key];
|
|
29903
|
+
if (Object.prototype.hasOwnProperty.call(item, key)) {
|
|
29904
|
+
tempData[targetKey] = item[key];
|
|
29905
|
+
}
|
|
29906
|
+
}
|
|
29907
|
+
}
|
|
29908
|
+
return tempData;
|
|
29909
|
+
});
|
|
29910
|
+
} else {
|
|
29911
|
+
addData = selections.map((item) => ({
|
|
29912
|
+
[pickParentFieldName]: item.srfkey
|
|
29913
|
+
}));
|
|
29914
|
+
}
|
|
29915
|
+
const service = ibiz.hub.getApp(context.srfappid).deService;
|
|
29916
|
+
await service.exec(selfDe.id, "Create", context, addData);
|
|
29601
29917
|
}
|
|
29602
|
-
return findView;
|
|
29603
29918
|
}
|
|
29604
29919
|
};
|
|
29605
29920
|
|
|
@@ -29927,6 +30242,7 @@ export {
|
|
|
29927
30242
|
PortletPartController,
|
|
29928
30243
|
PortletPartState,
|
|
29929
30244
|
QXEventEx,
|
|
30245
|
+
RawValueUtil,
|
|
29930
30246
|
RegisterCenter,
|
|
29931
30247
|
RemotePluginItem,
|
|
29932
30248
|
ScriptFactory,
|
|
@@ -30005,6 +30321,7 @@ export {
|
|
|
30005
30321
|
getControlProvider,
|
|
30006
30322
|
getControlsByView,
|
|
30007
30323
|
getDeACMode,
|
|
30324
|
+
getDefaultValue,
|
|
30008
30325
|
getEditorProvider,
|
|
30009
30326
|
getFormDetailProvider,
|
|
30010
30327
|
getFormTypeFieldName,
|