@ibiz-template/runtime 0.5.3-beta.2 → 0.5.3-beta.3
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 +92 -31
- package/dist/index.system.min.js +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +8 -1
- package/out/controller/common/editor/editor.controller.d.ts +24 -0
- package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
- package/out/controller/common/editor/editor.controller.js +50 -0
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +3 -2
- package/out/controller/control/chart/chart.controller.js +1 -1
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +8 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts +1 -1
- package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/front-ui-action-provider.js +4 -1
- package/package.json +2 -2
- package/src/command/app/open-app-view/open-app-view.ts +8 -1
- package/src/controller/common/editor/editor.controller.ts +54 -0
- package/src/controller/common/view/view.controller.ts +3 -2
- package/src/controller/control/chart/chart.controller.ts +1 -1
- package/src/plugin/remote-plugin-item/remote-plugin-item.ts +8 -0
- package/src/ui-action/provider/front-ui-action-provider.ts +9 -1
package/dist/index.esm.js
CHANGED
|
@@ -10088,7 +10088,13 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
|
|
|
10088
10088
|
);
|
|
10089
10089
|
}
|
|
10090
10090
|
const { openMode = "INDEXVIEWTAB" } = appView;
|
|
10091
|
-
|
|
10091
|
+
const viewOpenMode = opts.openMode || openMode;
|
|
10092
|
+
if (viewOpenMode !== void 0 && viewOpenMode !== "INDEXVIEWTAB") {
|
|
10093
|
+
if (context.toRouteDepth) {
|
|
10094
|
+
delete context.toRouteDepth;
|
|
10095
|
+
}
|
|
10096
|
+
}
|
|
10097
|
+
switch (viewOpenMode) {
|
|
10092
10098
|
case "INDEXVIEWTAB":
|
|
10093
10099
|
if (opts.noWaitRoute) {
|
|
10094
10100
|
this.openIndexViewTab(appView, context, params);
|
|
@@ -12204,6 +12210,7 @@ var ViewController = class extends BaseController {
|
|
|
12204
12210
|
(_a = this.scheduler) == null ? void 0 : _a.startTimerTrigger();
|
|
12205
12211
|
}
|
|
12206
12212
|
async onDestroyed() {
|
|
12213
|
+
const srfSessionId = this.context.srfsessionid;
|
|
12207
12214
|
await super.onDestroyed();
|
|
12208
12215
|
if (this.engines.length) {
|
|
12209
12216
|
await Promise.all(this.engines.map((engine) => engine.onDestroyed()));
|
|
@@ -12213,8 +12220,8 @@ var ViewController = class extends BaseController {
|
|
|
12213
12220
|
if (this.scheduler) {
|
|
12214
12221
|
this.scheduler.destroy();
|
|
12215
12222
|
}
|
|
12216
|
-
if (this.id ===
|
|
12217
|
-
ibiz.uiDomainManager.destroy(
|
|
12223
|
+
if (this.id === srfSessionId) {
|
|
12224
|
+
ibiz.uiDomainManager.destroy(srfSessionId);
|
|
12218
12225
|
}
|
|
12219
12226
|
this.context.destroy();
|
|
12220
12227
|
ibiz.log.debug("\u89C6\u56FE[".concat(this.model.name, "](").concat(this.model.id, ")\u9500\u6BC1"));
|
|
@@ -12402,6 +12409,8 @@ var WFStepTraceViewController = class extends ViewController {
|
|
|
12402
12409
|
};
|
|
12403
12410
|
|
|
12404
12411
|
// src/controller/common/editor/editor.controller.ts
|
|
12412
|
+
import { DataTypes as DataTypes3 } from "@ibiz-template/core";
|
|
12413
|
+
import dayjs2 from "dayjs";
|
|
12405
12414
|
var EditorController = class {
|
|
12406
12415
|
/**
|
|
12407
12416
|
* Creates an instance of EditorController.
|
|
@@ -12447,6 +12456,26 @@ var EditorController = class {
|
|
|
12447
12456
|
get readonly() {
|
|
12448
12457
|
return !!this.model.readOnly;
|
|
12449
12458
|
}
|
|
12459
|
+
/**
|
|
12460
|
+
* 值格式化
|
|
12461
|
+
* @author lxm
|
|
12462
|
+
* @date 2024-01-11 10:18:33
|
|
12463
|
+
* @readonly
|
|
12464
|
+
* @type {(string | undefined)}
|
|
12465
|
+
*/
|
|
12466
|
+
get valueFormat() {
|
|
12467
|
+
return this.parent.valueFormat;
|
|
12468
|
+
}
|
|
12469
|
+
/**
|
|
12470
|
+
* 数据类型
|
|
12471
|
+
* @author lxm
|
|
12472
|
+
* @date 2024-01-11 10:18:55
|
|
12473
|
+
* @readonly
|
|
12474
|
+
* @type {(number | undefined)}
|
|
12475
|
+
*/
|
|
12476
|
+
get dataType() {
|
|
12477
|
+
return this.parent.dataType;
|
|
12478
|
+
}
|
|
12450
12479
|
/**
|
|
12451
12480
|
* 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
|
|
12452
12481
|
*
|
|
@@ -12529,6 +12558,31 @@ var EditorController = class {
|
|
|
12529
12558
|
toBoolean(value) {
|
|
12530
12559
|
return Object.is("true", value);
|
|
12531
12560
|
}
|
|
12561
|
+
/**
|
|
12562
|
+
* 值格式化
|
|
12563
|
+
* @author lxm
|
|
12564
|
+
* @date 2023-08-25 05:18:11
|
|
12565
|
+
* @param {unknown} value
|
|
12566
|
+
* @return {*} {string}
|
|
12567
|
+
*/
|
|
12568
|
+
formatValue(value = "") {
|
|
12569
|
+
if (this.model.valueType !== "SIMPLE") {
|
|
12570
|
+
return ValueExUtil.toText(this.model, value);
|
|
12571
|
+
}
|
|
12572
|
+
const strVal = "".concat(value);
|
|
12573
|
+
if (!this.valueFormat) {
|
|
12574
|
+
return strVal;
|
|
12575
|
+
}
|
|
12576
|
+
const isDate = DataTypes3.isDate(this.dataType);
|
|
12577
|
+
if (isDate) {
|
|
12578
|
+
const formatVal = dayjs2(strVal).format(this.valueFormat);
|
|
12579
|
+
if (formatVal !== "Invalid Date") {
|
|
12580
|
+
return formatVal;
|
|
12581
|
+
}
|
|
12582
|
+
return strVal;
|
|
12583
|
+
}
|
|
12584
|
+
return ibiz.util.text.format(strVal, this.valueFormat);
|
|
12585
|
+
}
|
|
12532
12586
|
};
|
|
12533
12587
|
|
|
12534
12588
|
// src/controller/common/editor/code-list-editor.controller.ts
|
|
@@ -13591,7 +13645,7 @@ var AppMenuIconViewController = class extends AppMenuController {
|
|
|
13591
13645
|
};
|
|
13592
13646
|
|
|
13593
13647
|
// src/controller/control/calendar/calendar.controller.ts
|
|
13594
|
-
import
|
|
13648
|
+
import dayjs3 from "dayjs";
|
|
13595
13649
|
|
|
13596
13650
|
// src/controller/control/calendar/calendar.service.ts
|
|
13597
13651
|
import { RuntimeError as RuntimeError36 } from "@ibiz-template/core";
|
|
@@ -13749,9 +13803,9 @@ var CalendarController = class extends MDControlController {
|
|
|
13749
13803
|
const x = a.beginTime;
|
|
13750
13804
|
const y = b.beginTime;
|
|
13751
13805
|
let result = 0;
|
|
13752
|
-
if (
|
|
13806
|
+
if (dayjs3(x).isAfter(y)) {
|
|
13753
13807
|
result = -1;
|
|
13754
|
-
} else if (
|
|
13808
|
+
} else if (dayjs3(x).isBefore(y)) {
|
|
13755
13809
|
result = 1;
|
|
13756
13810
|
}
|
|
13757
13811
|
return result;
|
|
@@ -13783,8 +13837,8 @@ var CalendarController = class extends MDControlController {
|
|
|
13783
13837
|
1
|
|
13784
13838
|
);
|
|
13785
13839
|
return {
|
|
13786
|
-
srfstartdate:
|
|
13787
|
-
srfenddate:
|
|
13840
|
+
srfstartdate: dayjs3(firstDayOfMonth).format("YYYY-MM-DD HH:mm:ss"),
|
|
13841
|
+
srfenddate: dayjs3(lastDayOfMonth).format("YYYY-MM-DD HH:mm:ss")
|
|
13788
13842
|
};
|
|
13789
13843
|
}
|
|
13790
13844
|
return { srfstartdate, srfenddate };
|
|
@@ -13873,18 +13927,18 @@ import { RuntimeModelError as RuntimeModelError28 } from "@ibiz-template/core";
|
|
|
13873
13927
|
|
|
13874
13928
|
// src/controller/control/chart/generator/base-series-generator.ts
|
|
13875
13929
|
import { plus, RuntimeModelError as RuntimeModelError27, toNumberOrNil } from "@ibiz-template/core";
|
|
13876
|
-
import
|
|
13930
|
+
import dayjs4 from "dayjs";
|
|
13877
13931
|
import minMax from "dayjs/plugin/minMax";
|
|
13878
13932
|
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
|
|
13879
13933
|
import quarterOfYear from "dayjs/plugin/quarterOfYear";
|
|
13880
13934
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
13881
13935
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
13882
13936
|
import { clone as clone17, isNil as isNil21, mergeDeepRight } from "ramda";
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
|
|
13937
|
+
dayjs4.extend(minMax);
|
|
13938
|
+
dayjs4.extend(isSameOrBefore);
|
|
13939
|
+
dayjs4.extend(quarterOfYear);
|
|
13940
|
+
dayjs4.extend(weekOfYear);
|
|
13941
|
+
dayjs4.extend(isoWeek);
|
|
13888
13942
|
var DEFAULT_GROUP = "$default_group";
|
|
13889
13943
|
var BaseSeriesGenerator = class {
|
|
13890
13944
|
/**
|
|
@@ -14169,25 +14223,25 @@ var BaseSeriesGenerator = class {
|
|
|
14169
14223
|
format = "YYYY-MM";
|
|
14170
14224
|
}
|
|
14171
14225
|
if (singleData[this.catalogField]) {
|
|
14172
|
-
const formattedDate =
|
|
14226
|
+
const formattedDate = dayjs4(singleData[this.catalogField]).format(
|
|
14173
14227
|
format
|
|
14174
14228
|
);
|
|
14175
14229
|
singleData[this.catalogField] = formattedDate;
|
|
14176
14230
|
}
|
|
14177
14231
|
} else if (groupMode === "QUARTER") {
|
|
14178
14232
|
if (singleData[this.catalogField]) {
|
|
14179
|
-
const formattedDate = "".concat(
|
|
14233
|
+
const formattedDate = "".concat(dayjs4(
|
|
14180
14234
|
singleData[this.catalogField]
|
|
14181
|
-
).format("YYYY"), "-").concat(
|
|
14235
|
+
).format("YYYY"), "-").concat(dayjs4(
|
|
14182
14236
|
singleData[this.catalogField]
|
|
14183
14237
|
).quarter());
|
|
14184
14238
|
singleData[this.catalogField] = formattedDate;
|
|
14185
14239
|
}
|
|
14186
14240
|
} else if (groupMode === "YEARWEEK") {
|
|
14187
14241
|
if (singleData[this.catalogField]) {
|
|
14188
|
-
const formattedDate = "".concat(
|
|
14242
|
+
const formattedDate = "".concat(dayjs4(
|
|
14189
14243
|
singleData[this.catalogField]
|
|
14190
|
-
).format("YYYY"), "-").concat(
|
|
14244
|
+
).format("YYYY"), "-").concat(dayjs4(singleData[this.catalogField]).week());
|
|
14191
14245
|
singleData[this.catalogField] = formattedDate;
|
|
14192
14246
|
}
|
|
14193
14247
|
}
|
|
@@ -14209,7 +14263,7 @@ var BaseSeriesGenerator = class {
|
|
|
14209
14263
|
let sortedKeys = [];
|
|
14210
14264
|
if (groupMode === "DAY" || groupMode === "YEAR" || groupMode === "MONTH") {
|
|
14211
14265
|
sortedKeys = Array.from(dateMap.keys()).sort(
|
|
14212
|
-
(a, b) =>
|
|
14266
|
+
(a, b) => dayjs4(a).diff(dayjs4(b))
|
|
14213
14267
|
);
|
|
14214
14268
|
} else if (groupMode === "QUARTER" || groupMode === "YEARWEEK") {
|
|
14215
14269
|
sortedKeys = Array.from(dateMap.keys()).sort((a, b) => {
|
|
@@ -14243,11 +14297,11 @@ var BaseSeriesGenerator = class {
|
|
|
14243
14297
|
const dates = [];
|
|
14244
14298
|
Object.keys(data).forEach((key) => {
|
|
14245
14299
|
data[key].forEach((_val, date) => {
|
|
14246
|
-
dates.push(
|
|
14300
|
+
dates.push(dayjs4(date));
|
|
14247
14301
|
});
|
|
14248
14302
|
});
|
|
14249
|
-
const maxDate =
|
|
14250
|
-
const minDate =
|
|
14303
|
+
const maxDate = dayjs4.max(dates);
|
|
14304
|
+
const minDate = dayjs4.min(dates);
|
|
14251
14305
|
if (groupMode === "DAY") {
|
|
14252
14306
|
let currentDate = minDate;
|
|
14253
14307
|
const endDate = maxDate;
|
|
@@ -14329,7 +14383,7 @@ var BaseSeriesGenerator = class {
|
|
|
14329
14383
|
const [minYear] = minYearWeek.split("-");
|
|
14330
14384
|
const [maxYear] = maxYearWeek.split("-");
|
|
14331
14385
|
for (let year = parseInt(minYear, 10); year <= parseInt(maxYear, 10); year++) {
|
|
14332
|
-
const numWeeks =
|
|
14386
|
+
const numWeeks = dayjs4("".concat(year, "-12-31")).isoWeek();
|
|
14333
14387
|
for (let week = 1; week <= numWeeks; week++) {
|
|
14334
14388
|
const yearWeek = "".concat(year, "-").concat(week);
|
|
14335
14389
|
Object.keys(data).forEach((key) => {
|
|
@@ -14993,7 +15047,7 @@ var ChartController = class extends MDControlController {
|
|
|
14993
15047
|
if (!this.options) {
|
|
14994
15048
|
throw new RuntimeError38("options\u8FD8\u6CA1\u8BA1\u7B97");
|
|
14995
15049
|
}
|
|
14996
|
-
this.chart.setOption(this.options);
|
|
15050
|
+
this.chart.setOption(this.options, { notMerge: true });
|
|
14997
15051
|
this.resizeChart();
|
|
14998
15052
|
}
|
|
14999
15053
|
/**
|
|
@@ -16993,8 +17047,14 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
16993
17047
|
* @param {IUILogicParams} args
|
|
16994
17048
|
* @return {*}
|
|
16995
17049
|
*/
|
|
16996
|
-
async executeDataImport(action,
|
|
17050
|
+
async executeDataImport(action, args) {
|
|
16997
17051
|
var _a;
|
|
17052
|
+
const { resultParams } = await this.handleParams(
|
|
17053
|
+
action,
|
|
17054
|
+
args.context,
|
|
17055
|
+
args.data,
|
|
17056
|
+
args.params
|
|
17057
|
+
);
|
|
16998
17058
|
const appDataEntity = await ibiz.hub.getAppDataEntity(
|
|
16999
17059
|
action.appDataEntityId,
|
|
17000
17060
|
action.appId
|
|
@@ -17012,7 +17072,8 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
|
|
|
17012
17072
|
{
|
|
17013
17073
|
dismiss: () => modal.dismiss(),
|
|
17014
17074
|
appDataEntity,
|
|
17015
|
-
dataImport: appDEDataImport
|
|
17075
|
+
dataImport: appDEDataImport,
|
|
17076
|
+
params: resultParams
|
|
17016
17077
|
},
|
|
17017
17078
|
{
|
|
17018
17079
|
width: "auto",
|
|
@@ -23457,8 +23518,8 @@ var GridController = class extends MDControlController {
|
|
|
23457
23518
|
};
|
|
23458
23519
|
|
|
23459
23520
|
// src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
|
|
23460
|
-
import { DataTypes as
|
|
23461
|
-
import
|
|
23521
|
+
import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
|
|
23522
|
+
import dayjs5 from "dayjs";
|
|
23462
23523
|
import { debounce as debounce3 } from "lodash-es";
|
|
23463
23524
|
import { clone as clone24, isNil as isNil23 } from "ramda";
|
|
23464
23525
|
var GridFieldColumnController = class extends GridColumnController {
|
|
@@ -23722,9 +23783,9 @@ var GridFieldColumnController = class extends GridColumnController {
|
|
|
23722
23783
|
if (!this.valueFormat) {
|
|
23723
23784
|
return strVal;
|
|
23724
23785
|
}
|
|
23725
|
-
const isDate =
|
|
23786
|
+
const isDate = DataTypes4.isDate(this.dataType);
|
|
23726
23787
|
if (isDate) {
|
|
23727
|
-
const formatVal =
|
|
23788
|
+
const formatVal = dayjs5(strVal).format(this.valueFormat);
|
|
23728
23789
|
if (formatVal !== "Invalid Date") {
|
|
23729
23790
|
return formatVal;
|
|
23730
23791
|
}
|