@ibiz-template/runtime 0.3.0 → 0.3.1
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 +45 -41
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/out/service/service/async-action/async-action.service.d.ts.map +1 -1
- package/out/service/service/async-action/async-action.service.js +4 -0
- package/package.json +2 -2
- package/src/service/service/async-action/async-action.service.ts +4 -0
package/dist/index.esm.js
CHANGED
|
@@ -8173,6 +8173,7 @@ var V7AuthService = class {
|
|
|
8173
8173
|
};
|
|
8174
8174
|
|
|
8175
8175
|
// src/service/service/async-action/async-action.service.ts
|
|
8176
|
+
import { isNil as isNil11 } from "ramda";
|
|
8176
8177
|
var AsyncActionService = class {
|
|
8177
8178
|
/**
|
|
8178
8179
|
* 获取异步操作的集合
|
|
@@ -8183,6 +8184,9 @@ var AsyncActionService = class {
|
|
|
8183
8184
|
*/
|
|
8184
8185
|
async fetch(params = {}) {
|
|
8185
8186
|
const res = await ibiz.net.post("/portal/asyncaction/all", params);
|
|
8187
|
+
if (isNil11(res.data)) {
|
|
8188
|
+
res.data = [];
|
|
8189
|
+
}
|
|
8186
8190
|
return res;
|
|
8187
8191
|
}
|
|
8188
8192
|
/**
|
|
@@ -8361,7 +8365,7 @@ var TreeStaticNodeData = class extends TreeNodeData {
|
|
|
8361
8365
|
|
|
8362
8366
|
// src/service/vo/ui-map-field.ts
|
|
8363
8367
|
import { DataTypes as DataTypes2 } from "@ibiz-template/core";
|
|
8364
|
-
import { isNil as
|
|
8368
|
+
import { isNil as isNil12 } from "ramda";
|
|
8365
8369
|
var UIMapField = class {
|
|
8366
8370
|
constructor(uiKey, dataKey, opts = {}) {
|
|
8367
8371
|
/**
|
|
@@ -8382,10 +8386,10 @@ var UIMapField = class {
|
|
|
8382
8386
|
this.isRequestNeed = true;
|
|
8383
8387
|
this.uiKey = uiKey;
|
|
8384
8388
|
this.dataKey = dataKey;
|
|
8385
|
-
if (!
|
|
8389
|
+
if (!isNil12(opts.isOriginField)) {
|
|
8386
8390
|
this.isOriginField = opts.isOriginField;
|
|
8387
8391
|
}
|
|
8388
|
-
if (!
|
|
8392
|
+
if (!isNil12(opts.dataType)) {
|
|
8389
8393
|
this.dataType = opts.dataType;
|
|
8390
8394
|
}
|
|
8391
8395
|
}
|
|
@@ -8400,7 +8404,7 @@ var UIMapField = class {
|
|
|
8400
8404
|
return value;
|
|
8401
8405
|
}
|
|
8402
8406
|
if (DataTypes2.isNumber(this.dataType)) {
|
|
8403
|
-
const numVal = !
|
|
8407
|
+
const numVal = !isNil12(value) && value !== "" ? Number(value) : value;
|
|
8404
8408
|
if (Number.isNaN(numVal)) {
|
|
8405
8409
|
ibiz.log.debug("".concat(value, "\u4E0D\u80FD\u8F6C\u6362\u6210\u6570\u5B57"));
|
|
8406
8410
|
return value;
|
|
@@ -9382,7 +9386,7 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
|
|
|
9382
9386
|
// src/controller/common/view/view.controller.ts
|
|
9383
9387
|
import { createUUID as createUUID6, notNilEmpty as notNilEmpty6 } from "qx-util";
|
|
9384
9388
|
import { IBizContext as IBizContext2, RuntimeError as RuntimeError28 } from "@ibiz-template/core";
|
|
9385
|
-
import { isEmpty as isEmpty8, isNil as
|
|
9389
|
+
import { isEmpty as isEmpty8, isNil as isNil18, isNotNil as isNotNil2 } from "ramda";
|
|
9386
9390
|
|
|
9387
9391
|
// src/controller/utils/loading/loading.state.ts
|
|
9388
9392
|
import { NOOP } from "@ibiz-template/core";
|
|
@@ -9994,9 +9998,9 @@ function hasSubRoute(routeDepth) {
|
|
|
9994
9998
|
}
|
|
9995
9999
|
|
|
9996
10000
|
// src/controller/utils/util/util.ts
|
|
9997
|
-
import { isNil as
|
|
10001
|
+
import { isNil as isNil13 } from "ramda";
|
|
9998
10002
|
function isValueChange(value, value2) {
|
|
9999
|
-
if ((
|
|
10003
|
+
if ((isNil13(value) || value === "") && (isNil13(value2) || value2 === "")) {
|
|
10000
10004
|
return false;
|
|
10001
10005
|
}
|
|
10002
10006
|
return value !== value2;
|
|
@@ -10012,7 +10016,7 @@ function getOriginData(data) {
|
|
|
10012
10016
|
// src/controller/utils/value-rule/value-rule.ts
|
|
10013
10017
|
import { RuntimeError as RuntimeError23 } from "@ibiz-template/core";
|
|
10014
10018
|
import { isNilOrEmpty as isNilOrEmpty7, isNumber } from "qx-util";
|
|
10015
|
-
import { isNil as
|
|
10019
|
+
import { isNil as isNil14 } from "ramda";
|
|
10016
10020
|
function generateRules(itemVRs, name, valueItemName) {
|
|
10017
10021
|
const rules = [];
|
|
10018
10022
|
itemVRs.forEach((item) => {
|
|
@@ -10077,7 +10081,7 @@ function generateEditorRules(editor) {
|
|
|
10077
10081
|
if (maxLength) {
|
|
10078
10082
|
rules.push({
|
|
10079
10083
|
validator: (rule, value, callback) => {
|
|
10080
|
-
if (!
|
|
10084
|
+
if (!isNil14(value) && value.length > maxLength) {
|
|
10081
10085
|
callback(
|
|
10082
10086
|
new Error(
|
|
10083
10087
|
"\u5185\u5BB9\u957F\u5EA6\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E".concat(maxLength, ",\u5F53\u524D\u957F\u5EA6\u4E3A").concat(value.length)
|
|
@@ -10092,7 +10096,7 @@ function generateEditorRules(editor) {
|
|
|
10092
10096
|
if (minLength) {
|
|
10093
10097
|
rules.push({
|
|
10094
10098
|
validator: (rule, value, callback) => {
|
|
10095
|
-
if (!
|
|
10099
|
+
if (!isNil14(value) && value.length < minLength) {
|
|
10096
10100
|
callback(
|
|
10097
10101
|
new Error(
|
|
10098
10102
|
"\u5185\u5BB9\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E".concat(minLength, ",\u5F53\u524D\u957F\u5EA6\u4E3A").concat(value.length)
|
|
@@ -10104,10 +10108,10 @@ function generateEditorRules(editor) {
|
|
|
10104
10108
|
}
|
|
10105
10109
|
});
|
|
10106
10110
|
}
|
|
10107
|
-
if (!
|
|
10111
|
+
if (!isNil14(maxValue)) {
|
|
10108
10112
|
rules.push({
|
|
10109
10113
|
validator: (rule, value, callback) => {
|
|
10110
|
-
if (!
|
|
10114
|
+
if (!isNil14(value) && isNumber(value) && value > maxValue) {
|
|
10111
10115
|
callback(new Error("\u503C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E".concat(maxValue)));
|
|
10112
10116
|
} else {
|
|
10113
10117
|
return true;
|
|
@@ -10115,10 +10119,10 @@ function generateEditorRules(editor) {
|
|
|
10115
10119
|
}
|
|
10116
10120
|
});
|
|
10117
10121
|
}
|
|
10118
|
-
if (!
|
|
10122
|
+
if (!isNil14(minValue)) {
|
|
10119
10123
|
rules.push({
|
|
10120
10124
|
validator: (rule, value, callback) => {
|
|
10121
|
-
if (!
|
|
10125
|
+
if (!isNil14(value) && isNumber(value) && value < minValue) {
|
|
10122
10126
|
callback(new Error("\u503C\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E".concat(minValue)));
|
|
10123
10127
|
} else {
|
|
10124
10128
|
return true;
|
|
@@ -10131,7 +10135,7 @@ function generateEditorRules(editor) {
|
|
|
10131
10135
|
|
|
10132
10136
|
// src/controller/utils/value-ex/value-ex.ts
|
|
10133
10137
|
import { RuntimeError as RuntimeError24 } from "@ibiz-template/core";
|
|
10134
|
-
import { isNil as
|
|
10138
|
+
import { isNil as isNil15, mergeLeft } from "ramda";
|
|
10135
10139
|
var ValueExUtil = class {
|
|
10136
10140
|
/**
|
|
10137
10141
|
* 合并默认值
|
|
@@ -10156,7 +10160,7 @@ var ValueExUtil = class {
|
|
|
10156
10160
|
* @return {*} {string}
|
|
10157
10161
|
*/
|
|
10158
10162
|
static toText(options, value) {
|
|
10159
|
-
if (
|
|
10163
|
+
if (isNil15(value) || value === "") {
|
|
10160
10164
|
return "";
|
|
10161
10165
|
}
|
|
10162
10166
|
const { valueType, objectNameField, textSeparator } = this.mergeDefault(options);
|
|
@@ -10181,12 +10185,12 @@ var ValueExUtil = class {
|
|
|
10181
10185
|
import { RuntimeError as RuntimeError25, ModelError as ModelError16 } from "@ibiz-template/core";
|
|
10182
10186
|
import dayjs from "dayjs";
|
|
10183
10187
|
import { createUUID as createUUID5 } from "qx-util";
|
|
10184
|
-
import { isNil as
|
|
10188
|
+
import { isNil as isNil16, isNotNil } from "ramda";
|
|
10185
10189
|
function getDefaultValue(opts, origins) {
|
|
10186
10190
|
var _a;
|
|
10187
10191
|
const { name, valueType, defaultValue, valueFormat } = opts;
|
|
10188
10192
|
const { data, context, params } = origins;
|
|
10189
|
-
if (
|
|
10193
|
+
if (isNil16(valueType) && isNil16(defaultValue)) {
|
|
10190
10194
|
return;
|
|
10191
10195
|
}
|
|
10192
10196
|
if (valueType === "RESET") {
|
|
@@ -10512,7 +10516,7 @@ var BaseController = class {
|
|
|
10512
10516
|
|
|
10513
10517
|
// src/controller/utils/view-msg/view-msg-controller.ts
|
|
10514
10518
|
import { RuntimeError as RuntimeError27, RuntimeModelError as RuntimeModelError20 } from "@ibiz-template/core";
|
|
10515
|
-
import { isNil as
|
|
10519
|
+
import { isNil as isNil17, mergeRight as mergeRight2 } from "ramda";
|
|
10516
10520
|
var ViewMsgController = class _ViewMsgController {
|
|
10517
10521
|
constructor(msgGroupId) {
|
|
10518
10522
|
this.msgGroupId = msgGroupId;
|
|
@@ -10697,19 +10701,19 @@ var ViewMsgController = class _ViewMsgController {
|
|
|
10697
10701
|
const removeModeField = this.getDeFieldName(entity, removeFlagAppDEFieldId);
|
|
10698
10702
|
const deViewMessages = dataSet.map((item) => {
|
|
10699
10703
|
const message = {};
|
|
10700
|
-
if (positionField && !
|
|
10704
|
+
if (positionField && !isNil17(item[positionField])) {
|
|
10701
10705
|
message.position = item[positionField];
|
|
10702
10706
|
}
|
|
10703
|
-
if (titleField && !
|
|
10707
|
+
if (titleField && !isNil17(item[titleField])) {
|
|
10704
10708
|
message.title = item[titleField];
|
|
10705
10709
|
}
|
|
10706
|
-
if (messageField && !
|
|
10710
|
+
if (messageField && !isNil17(item[messageField])) {
|
|
10707
10711
|
message.message = item[messageField];
|
|
10708
10712
|
}
|
|
10709
|
-
if (typeField && !
|
|
10713
|
+
if (typeField && !isNil17(item[typeField])) {
|
|
10710
10714
|
message.messageType = item[typeField];
|
|
10711
10715
|
}
|
|
10712
|
-
if (removeModeField && !
|
|
10716
|
+
if (removeModeField && !isNil17(item[removeModeField])) {
|
|
10713
10717
|
message.removeMode = item[removeModeField];
|
|
10714
10718
|
}
|
|
10715
10719
|
return mergeRight2(basicMsg, message);
|
|
@@ -10931,7 +10935,7 @@ var ViewController = class extends BaseController {
|
|
|
10931
10935
|
*/
|
|
10932
10936
|
handleContextParams() {
|
|
10933
10937
|
this.context.srfappid = this.model.appId;
|
|
10934
|
-
if (
|
|
10938
|
+
if (isNil18(this.context.srfsessionid) || isEmpty8(this.context.srfsessionid)) {
|
|
10935
10939
|
this.context.srfsessionid = createUUID6();
|
|
10936
10940
|
}
|
|
10937
10941
|
const navContexts = this.model.appViewNavContexts;
|
|
@@ -11251,7 +11255,7 @@ var CodeListEditorController = class extends EditorController {
|
|
|
11251
11255
|
|
|
11252
11256
|
// src/controller/common/control/control.controller.ts
|
|
11253
11257
|
import { IBizContext as IBizContext3, IBizParams, NoticeError } from "@ibiz-template/core";
|
|
11254
|
-
import { isNil as
|
|
11258
|
+
import { isNil as isNil19 } from "ramda";
|
|
11255
11259
|
import { notNilEmpty as notNilEmpty7 } from "qx-util";
|
|
11256
11260
|
var ControlController = class extends BaseController {
|
|
11257
11261
|
/**
|
|
@@ -11515,7 +11519,7 @@ var ControlController = class extends BaseController {
|
|
|
11515
11519
|
let message;
|
|
11516
11520
|
let duration;
|
|
11517
11521
|
if (msgItem && msgItem.content) {
|
|
11518
|
-
duration =
|
|
11522
|
+
duration = isNil19(msgItem.timeout) ? void 0 : msgItem.timeout / 1e3;
|
|
11519
11523
|
const scriptParams = { ...this.getEventArgs() };
|
|
11520
11524
|
if (opts == null ? void 0 : opts.data) {
|
|
11521
11525
|
scriptParams.data = opts.data;
|
|
@@ -12341,7 +12345,7 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
|
12341
12345
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
12342
12346
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
12343
12347
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
12344
|
-
import { clone as clone14, isNil as
|
|
12348
|
+
import { clone as clone14, isNil as isNil20, mergeDeepRight } from "ramda";
|
|
12345
12349
|
dayjs3.extend(minMax);
|
|
12346
12350
|
dayjs3.extend(isSameOrBefore);
|
|
12347
12351
|
dayjs3.extend(quarterOfYear);
|
|
@@ -12430,10 +12434,10 @@ var BaseSeriesGenerator = class {
|
|
|
12430
12434
|
* @return {*} {(string | undefined)}
|
|
12431
12435
|
*/
|
|
12432
12436
|
translateVal(codeListKey, val, isExclude = false) {
|
|
12433
|
-
if (
|
|
12437
|
+
if (isNil20(val)) {
|
|
12434
12438
|
return void 0;
|
|
12435
12439
|
}
|
|
12436
|
-
if (
|
|
12440
|
+
if (isNil20(codeListKey)) {
|
|
12437
12441
|
return val;
|
|
12438
12442
|
}
|
|
12439
12443
|
const codeListItems = this.chartGenerator.codeListMap.get(codeListKey);
|
|
@@ -12463,7 +12467,7 @@ var BaseSeriesGenerator = class {
|
|
|
12463
12467
|
seriesCodeListId,
|
|
12464
12468
|
item[this.groupField]
|
|
12465
12469
|
);
|
|
12466
|
-
if (
|
|
12470
|
+
if (isNil20(groupVal)) {
|
|
12467
12471
|
return;
|
|
12468
12472
|
}
|
|
12469
12473
|
group = groupVal;
|
|
@@ -15890,7 +15894,7 @@ var RawItemPortletController = class extends PortletPartController {
|
|
|
15890
15894
|
|
|
15891
15895
|
// src/controller/control/data-view/data-view.controller.ts
|
|
15892
15896
|
import { RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
|
|
15893
|
-
import { isNil as
|
|
15897
|
+
import { isNil as isNil21 } from "ramda";
|
|
15894
15898
|
|
|
15895
15899
|
// src/controller/control/data-view/data-view.service.ts
|
|
15896
15900
|
var DataViewControlService = class extends MDControlService {
|
|
@@ -16174,7 +16178,7 @@ var DataViewControlController = class extends MDControlController {
|
|
|
16174
16178
|
const groupMap = /* @__PURE__ */ new Map();
|
|
16175
16179
|
items.forEach((item) => {
|
|
16176
16180
|
const groupVal = item[groupAppDEFieldId];
|
|
16177
|
-
if (
|
|
16181
|
+
if (isNil21(groupVal)) {
|
|
16178
16182
|
return;
|
|
16179
16183
|
}
|
|
16180
16184
|
if (!groupMap.has(groupVal)) {
|
|
@@ -21374,7 +21378,7 @@ var GridController = class extends MDControlController {
|
|
|
21374
21378
|
import { DataTypes as DataTypes3, ModelError as ModelError26, plus as plus2 } from "@ibiz-template/core";
|
|
21375
21379
|
import dayjs4 from "dayjs";
|
|
21376
21380
|
import { debounce as debounce3 } from "lodash-es";
|
|
21377
|
-
import { clone as clone22, isNil as
|
|
21381
|
+
import { clone as clone22, isNil as isNil22 } from "ramda";
|
|
21378
21382
|
var GridFieldColumnController = class extends GridColumnController {
|
|
21379
21383
|
constructor() {
|
|
21380
21384
|
super(...arguments);
|
|
@@ -21552,7 +21556,7 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
21552
21556
|
return;
|
|
21553
21557
|
}
|
|
21554
21558
|
const fieldName = aggField || this.model.id;
|
|
21555
|
-
items = items.filter((item) => !
|
|
21559
|
+
items = items.filter((item) => !isNil22(item[fieldName]));
|
|
21556
21560
|
let aggValue;
|
|
21557
21561
|
if (this.grid.model.aggMode === "PAGE") {
|
|
21558
21562
|
switch (aggMode) {
|
|
@@ -22888,7 +22892,7 @@ var PickupViewPanelController = class extends ControlController {
|
|
|
22888
22892
|
|
|
22889
22893
|
// src/controller/control/search-bar/search-bar.controller.ts
|
|
22890
22894
|
import { recursiveIterate as recursiveIterate7 } from "@ibiz-template/core";
|
|
22891
|
-
import { isNil as
|
|
22895
|
+
import { isNil as isNil23 } from "ramda";
|
|
22892
22896
|
|
|
22893
22897
|
// src/controller/control/search-bar/search-bar-filter.controller.ts
|
|
22894
22898
|
import { RuntimeModelError as RuntimeModelError55 } from "@ibiz-template/core";
|
|
@@ -23095,7 +23099,7 @@ var SearchBarController = class extends ControlController {
|
|
|
23095
23099
|
let hasError = false;
|
|
23096
23100
|
recursiveIterate7(this.state.filterNodes[0], (node) => {
|
|
23097
23101
|
if (node.leaf) {
|
|
23098
|
-
if (node.field && node.valueOP && !
|
|
23102
|
+
if (node.field && node.valueOP && !isNil23(node.value)) {
|
|
23099
23103
|
hasFilter = true;
|
|
23100
23104
|
} else {
|
|
23101
23105
|
hasError = true;
|
|
@@ -24289,7 +24293,7 @@ var WizardPanelController = class extends ControlController {
|
|
|
24289
24293
|
|
|
24290
24294
|
// src/controller/control/md-ctrl/md-ctrl.controller.ts
|
|
24291
24295
|
import { RuntimeModelError as RuntimeModelError56 } from "@ibiz-template/core";
|
|
24292
|
-
import { isNil as
|
|
24296
|
+
import { isNil as isNil24 } from "ramda";
|
|
24293
24297
|
|
|
24294
24298
|
// src/controller/control/md-ctrl/md-ctrl.service.ts
|
|
24295
24299
|
var MDCtrlService = class extends MDControlService {
|
|
@@ -24532,7 +24536,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
24532
24536
|
const groupMap = /* @__PURE__ */ new Map();
|
|
24533
24537
|
items.forEach((item) => {
|
|
24534
24538
|
const groupVal = item[groupAppDEFieldId];
|
|
24535
|
-
if (
|
|
24539
|
+
if (isNil24(groupVal)) {
|
|
24536
24540
|
return;
|
|
24537
24541
|
}
|
|
24538
24542
|
if (!groupMap.has(groupVal)) {
|
|
@@ -24609,7 +24613,7 @@ var MDCtrlController = class extends MDControlController {
|
|
|
24609
24613
|
|
|
24610
24614
|
// src/controller/control/kanban/kanban.controller.ts
|
|
24611
24615
|
import { RuntimeError as RuntimeError52, RuntimeModelError as RuntimeModelError57 } from "@ibiz-template/core";
|
|
24612
|
-
import { isNil as
|
|
24616
|
+
import { isNil as isNil25 } from "ramda";
|
|
24613
24617
|
|
|
24614
24618
|
// src/controller/control/kanban/kanban.service.ts
|
|
24615
24619
|
var KanbanService = class extends DataViewControlService {
|
|
@@ -24691,7 +24695,7 @@ var KanbanController = class extends DataViewControlController {
|
|
|
24691
24695
|
const isAsc = minorSortDir === "ASC";
|
|
24692
24696
|
items.forEach((item) => {
|
|
24693
24697
|
const sortValue = item[sortField];
|
|
24694
|
-
if (
|
|
24698
|
+
if (isNil25(sortValue)) {
|
|
24695
24699
|
item[sortField] = 0;
|
|
24696
24700
|
} else {
|
|
24697
24701
|
const toNum = Number(sortValue);
|