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