@ibiz-template/runtime 0.7.41-alpha.103 → 0.7.41-alpha.105

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 (31) hide show
  1. package/dist/index.esm.js +103 -14
  2. package/dist/index.system.min.js +1 -1
  3. package/out/constant/index.d.ts +1 -0
  4. package/out/constant/index.d.ts.map +1 -1
  5. package/out/constant/index.js +1 -0
  6. package/out/constant/predefined-attributes.d.ts +18 -0
  7. package/out/constant/predefined-attributes.d.ts.map +1 -0
  8. package/out/constant/predefined-attributes.js +19 -0
  9. package/out/controller/control/calendar/calendar.controller.d.ts +13 -0
  10. package/out/controller/control/calendar/calendar.controller.d.ts.map +1 -1
  11. package/out/controller/control/calendar/calendar.controller.js +83 -10
  12. package/out/interface/api/controller/control/i-api-calendar.controller.d.ts +4 -0
  13. package/out/interface/api/controller/control/i-api-calendar.controller.d.ts.map +1 -1
  14. package/out/interface/api/state/control/i-api-calendar.state.d.ts +8 -2
  15. package/out/interface/api/state/control/i-api-calendar.state.d.ts.map +1 -1
  16. package/out/interface/api/state/control/index.d.ts +3 -3
  17. package/out/interface/api/state/control/index.d.ts.map +1 -1
  18. package/out/interface/controller/state/control/i-calendar.state.d.ts +19 -4
  19. package/out/interface/controller/state/control/i-calendar.state.d.ts.map +1 -1
  20. package/out/locale/en/index.d.ts +1 -0
  21. package/out/locale/en/index.d.ts.map +1 -1
  22. package/out/locale/en/index.js +1 -0
  23. package/out/locale/zh-CN/index.d.ts +1 -0
  24. package/out/locale/zh-CN/index.d.ts.map +1 -1
  25. package/out/locale/zh-CN/index.js +1 -0
  26. package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
  27. package/out/ui-action/provider/ui-action-provider-base.js +4 -2
  28. package/out/utils/model/index.d.ts +8 -1
  29. package/out/utils/model/index.d.ts.map +1 -1
  30. package/out/utils/model/index.js +19 -0
  31. package/package.json +2 -2
package/dist/index.esm.js CHANGED
@@ -20750,6 +20750,13 @@ var PredefinedControlRender = /* @__PURE__ */ ((PredefinedControlRender2) => {
20750
20750
  return PredefinedControlRender2;
20751
20751
  })(PredefinedControlRender || {});
20752
20752
 
20753
+ // src/constant/predefined-attributes.ts
20754
+ var PredefinedAttributes = /* @__PURE__ */ ((PredefinedAttributes2) => {
20755
+ PredefinedAttributes2["CLASSNAMES"] = "classNames";
20756
+ PredefinedAttributes2["STYLES"] = "styles";
20757
+ return PredefinedAttributes2;
20758
+ })(PredefinedAttributes || {});
20759
+
20753
20760
  // src/model/utils/util.ts
20754
20761
  function findModelChild(models, id) {
20755
20762
  if (models && id) {
@@ -34332,9 +34339,10 @@ var UIActionProviderBase = class {
34332
34339
  });
34333
34340
  }
34334
34341
  const isMultiData = ["MULTIKEY", "MULTIDATA"].includes(action.actionTarget) && data.length > 0;
34342
+ const singleNavData = action.actionTarget === "NONE" ? {} : data[0] || {};
34335
34343
  const tempContext = convertNavData(
34336
34344
  navContexts,
34337
- isMultiData ? formatMultiData(navContexts, data) : data[0] || {},
34345
+ isMultiData ? formatMultiData(navContexts, data) : singleNavData,
34338
34346
  params,
34339
34347
  context
34340
34348
  );
@@ -34342,7 +34350,7 @@ var UIActionProviderBase = class {
34342
34350
  const navParams = action.navigateParams;
34343
34351
  const resultParams = convertNavData(
34344
34352
  navParams,
34345
- isMultiData ? formatMultiData(navParams, data) : data[0] || {},
34353
+ isMultiData ? formatMultiData(navParams, data) : singleNavData,
34346
34354
  params,
34347
34355
  resultContext
34348
34356
  );
@@ -35630,6 +35638,17 @@ var CalendarController = class extends MDControlController {
35630
35638
  return this.controlParams.grouptimefield;
35631
35639
  return "beginTime";
35632
35640
  }
35641
+ /**
35642
+ * @description 时间范围模式
35643
+ * @readonly
35644
+ * @type {('custom' | 'quarter' | 'year' | 'halfYear')}
35645
+ * @memberof CalendarController
35646
+ */
35647
+ get timeRangeMode() {
35648
+ if (this.controlParams.timerangemode)
35649
+ return this.controlParams.timerangemode;
35650
+ return "year";
35651
+ }
35633
35652
  /**
35634
35653
  * 初始化状态
35635
35654
  *
@@ -35651,6 +35670,7 @@ var CalendarController = class extends MDControlController {
35651
35670
  this.state.size = 1e3;
35652
35671
  this.state.legends = [];
35653
35672
  this.state.groups = [];
35673
+ this.state.timeRange = [];
35654
35674
  this.state.calendarTitle = this.model.logicName || "";
35655
35675
  this.state.showDetail = false;
35656
35676
  }
@@ -35677,6 +35697,7 @@ var CalendarController = class extends MDControlController {
35677
35697
  this.state.showDetail = ((_d = (_c = this.model.controlParam) == null ? void 0 : _c.ctrlParams) == null ? void 0 : _d.SHOWDETAIL) || this.controlParams.showdetail === "true" || false;
35678
35698
  this.service = new CalendarService(this.model);
35679
35699
  await this.service.init(this.context);
35700
+ this.initTimeRange();
35680
35701
  this.initViewScheduler();
35681
35702
  this.initCalendarLegends();
35682
35703
  (_e = this.model.sysCalendarItems) == null ? void 0 : _e.forEach((item) => {
@@ -35694,6 +35715,59 @@ var CalendarController = class extends MDControlController {
35694
35715
  Object.values(this.contextMenus).map((menu) => menu.created())
35695
35716
  );
35696
35717
  }
35718
+ /**
35719
+ * @description 初始化时间范围
35720
+ * @protected
35721
+ * @memberof CalendarController
35722
+ */
35723
+ initTimeRange() {
35724
+ const { calendarStyle } = this.model;
35725
+ if (calendarStyle !== "USER2")
35726
+ return;
35727
+ switch (this.timeRangeMode) {
35728
+ case "year":
35729
+ this.state.timeRange = [
35730
+ dayjs3().startOf("year").toDate(),
35731
+ dayjs3().endOf("year").toDate()
35732
+ ];
35733
+ break;
35734
+ case "halfYear":
35735
+ const year = dayjs3().year();
35736
+ const isFirstHalf = dayjs3().month() < 6;
35737
+ if (isFirstHalf) {
35738
+ this.state.timeRange = [
35739
+ dayjs3("".concat(year, "-01-01")).toDate(),
35740
+ dayjs3("".concat(year, "-06-30")).toDate()
35741
+ ];
35742
+ } else {
35743
+ this.state.timeRange = [
35744
+ dayjs3("".concat(year, "-07-01")).toDate(),
35745
+ dayjs3("".concat(year, "-12-31")).toDate()
35746
+ ];
35747
+ }
35748
+ break;
35749
+ case "quarter":
35750
+ this.state.timeRange = [
35751
+ dayjs3().startOf("quarter").toDate(),
35752
+ dayjs3().endOf("quarter").toDate()
35753
+ ];
35754
+ break;
35755
+ case "custom":
35756
+ const { begintime } = this.controlParams;
35757
+ const { endtime } = this.controlParams;
35758
+ if (!begintime || !dayjs3(begintime).isValid() || !endtime || !dayjs3(endtime).isValid())
35759
+ throw new RuntimeError30(
35760
+ ibiz.i18n.t("runtime.controller.control.calendar.illegalTime")
35761
+ );
35762
+ this.state.timeRange = [
35763
+ dayjs3(begintime).toDate(),
35764
+ dayjs3(endtime).toDate()
35765
+ ];
35766
+ break;
35767
+ default:
35768
+ break;
35769
+ }
35770
+ }
35697
35771
  /**
35698
35772
  * @description 执行行为
35699
35773
  * @param {string} uiActionId
@@ -35730,19 +35804,18 @@ var CalendarController = class extends MDControlController {
35730
35804
  */
35731
35805
  initCalendarLegends() {
35732
35806
  const { sysCalendarItems } = this.model;
35733
- if (!sysCalendarItems) {
35807
+ if (!sysCalendarItems)
35734
35808
  throw new RuntimeError30(
35735
35809
  ibiz.i18n.t("runtime.controller.control.calendar.noFoundModel")
35736
35810
  );
35737
- }
35738
- sysCalendarItems.forEach((calendarItem) => {
35739
- const { id, name: name2, bkcolor, color } = calendarItem;
35740
- this.state.legends.push({
35741
- id,
35811
+ this.state.legends = sysCalendarItems.map((item) => {
35812
+ const { itemType = "", name: name2 = "", bkcolor, color } = item;
35813
+ return {
35742
35814
  name: name2,
35815
+ color,
35743
35816
  bkcolor,
35744
- color
35745
- });
35817
+ id: itemType
35818
+ };
35746
35819
  });
35747
35820
  }
35748
35821
  /**
@@ -36023,7 +36096,7 @@ var CalendarController = class extends MDControlController {
36023
36096
  * @memberof CalendarController
36024
36097
  */
36025
36098
  getCurSelectDate(param) {
36026
- const { selectedDate } = this.state;
36099
+ const { selectedDate, timeRange } = this.state;
36027
36100
  const { calendarStyle } = this.model;
36028
36101
  let { srfstartdate, srfenddate } = param;
36029
36102
  if (!srfstartdate || !srfenddate) {
@@ -36073,8 +36146,11 @@ var CalendarController = class extends MDControlController {
36073
36146
  ).getTime() - 1
36074
36147
  );
36075
36148
  break;
36149
+ case "USER2":
36150
+ srfstartdate = dayjs3(timeRange[0]).format("YYYY-MM-DD");
36151
+ srfenddate = dayjs3(timeRange[1]).format("YYYY-MM-DD");
36152
+ break;
36076
36153
  default:
36077
- ibiz.log.warn("\u65E5\u5386".concat(calendarStyle, "\u6837\u5F0F\u6682\u672A\u652F\u6301"));
36078
36154
  break;
36079
36155
  }
36080
36156
  return {
@@ -84947,6 +85023,15 @@ async function calcDynamicMenu(menu, context, params) {
84947
85023
  ibiz.log.error(error);
84948
85024
  }
84949
85025
  }
85026
+ var PREDEFINED_ATTR_NAMES = Object.values(PredefinedAttributes);
85027
+ function filterPresetAttrs(controlAttributes) {
85028
+ const targetAttrs = controlAttributes || [];
85029
+ if (targetAttrs.length === 0)
85030
+ return targetAttrs;
85031
+ return targetAttrs.filter((item) => {
85032
+ return item.attrName && !PREDEFINED_ATTR_NAMES.includes(item.attrName);
85033
+ });
85034
+ }
84950
85035
 
84951
85036
  // src/command/app/open-app-view/open-app-view.ts
84952
85037
  import { ModelError as ModelError30, RuntimeError as RuntimeError71 } from "@ibiz-template/core";
@@ -90315,7 +90400,8 @@ var en = {
90315
90400
  noConfigured: "No application functionality configured"
90316
90401
  },
90317
90402
  calendar: {
90318
- noFoundModel: "Calendar item model not found"
90403
+ noFoundModel: "Calendar item model not found",
90404
+ illegalTime: "[USER2] Calendar style with time range type [custom] does not have valid control dynamic parameters [begintime] and [endtime] configured"
90319
90405
  },
90320
90406
  chart: {
90321
90407
  noConfiguredX: "Sequence is not configured with X-axis",
@@ -90999,7 +91085,8 @@ var zhCn = {
90999
91085
  noConfigured: "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD"
91000
91086
  },
91001
91087
  calendar: {
91002
- noFoundModel: "\u672A\u627E\u5230\u65E5\u5386\u9879\u6A21\u578B"
91088
+ noFoundModel: "\u672A\u627E\u5230\u65E5\u5386\u9879\u6A21\u578B",
91089
+ illegalTime: "[USER2]\u65E5\u5386\u6837\u5F0F\u65F6\u95F4\u8303\u56F4\u7C7B\u578B\u4E3A[custom]\u7684\u65E5\u5386\u672A\u914D\u7F6E\u5408\u6CD5\u7684\u63A7\u4EF6\u52A8\u6001\u53C2\u6570 [begintime] \u548C [endtime]"
91003
91090
  },
91004
91091
  chart: {
91005
91092
  noConfiguredX: "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74",
@@ -91827,6 +91914,7 @@ export {
91827
91914
  PluginStaticResource,
91828
91915
  PortletPartController,
91829
91916
  PortletPartState,
91917
+ PredefinedAttributes,
91830
91918
  PredefinedControlRender,
91831
91919
  PresetIdentifier,
91832
91920
  QXEventEx,
@@ -91976,6 +92064,7 @@ export {
91976
92064
  filterNode2SearchCondEx,
91977
92065
  filterPortletByConfig,
91978
92066
  filterPortletByID,
92067
+ filterPresetAttrs,
91979
92068
  filterValueRules,
91980
92069
  findAppDEMethod,
91981
92070
  findChildFormDetails,