chbim-time-axis-v2 0.0.195 → 0.0.196

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.
@@ -12346,8 +12346,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12346
12346
  return !(i.left < scrollLeft.value - 100 || i.left > scrollLeft.value + containerWidth.value + 100);
12347
12347
  });
12348
12348
  }
12349
- if (isVisible || task.type === "instant") {
12350
- const shouldRender = isVisible || task.type === "instant";
12349
+ if (isVisible || task.type === "instant" || task.allowInstant) {
12350
+ const shouldRender = isVisible || task.type === "instant" || task.allowInstant;
12351
12351
  if (shouldRender) {
12352
12352
  const barData = {
12353
12353
  id: task.id,
@@ -12742,8 +12742,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12742
12742
  };
12743
12743
  }
12744
12744
  });
12745
- const TimelineChart_vue_vue_type_style_index_0_scoped_de1c4fcb_lang = "";
12746
- const TimelineChart = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-de1c4fcb"]]);
12745
+ const TimelineChart_vue_vue_type_style_index_0_scoped_77875d0b_lang = "";
12746
+ const TimelineChart = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-77875d0b"]]);
12747
12747
  const _hoisted_1 = { class: "toolbar" };
12748
12748
  const _hoisted_2 = { style: { "flex": "1", "display": "flex", "align-items": "center", "height": "100%" } };
12749
12749
  const _hoisted_3 = { class: "left-controls" };
@@ -12962,6 +12962,57 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12962
12962
  { immediate: true, deep: true }
12963
12963
  );
12964
12964
  const activeTaskIds = /* @__PURE__ */ new Set();
12965
+ const tasksWithComputedData = computed(() => {
12966
+ const process = (list) => {
12967
+ return list.map((task) => {
12968
+ if (task.type === "group") {
12969
+ const group = task;
12970
+ const rawChildren = group.children || [];
12971
+ const processedChildren = process(rawChildren);
12972
+ let minTime = Number.MAX_SAFE_INTEGER;
12973
+ let maxTime = Number.MIN_SAFE_INTEGER;
12974
+ if (processedChildren.length > 0) {
12975
+ processedChildren.forEach((child) => {
12976
+ const start = new Date(child.startTime).getTime();
12977
+ const end = new Date(child.endTime).getTime();
12978
+ if (!isNaN(start)) {
12979
+ if (start < minTime)
12980
+ minTime = start;
12981
+ }
12982
+ if (!isNaN(end)) {
12983
+ if (end > maxTime)
12984
+ maxTime = end;
12985
+ }
12986
+ });
12987
+ }
12988
+ const calculatedStart = minTime !== Number.MAX_SAFE_INTEGER ? new Date(minTime).toISOString() : "";
12989
+ const calculatedEnd = maxTime !== Number.MIN_SAFE_INTEGER ? new Date(maxTime).toISOString() : "";
12990
+ const childrenWithWarnings = processedChildren.map((child) => {
12991
+ let warning = void 0;
12992
+ if (group.limitStartTime && dayjs(child.startTime).isBefore(dayjs(group.limitStartTime))) {
12993
+ warning = "开始时间早于分组限制";
12994
+ }
12995
+ if (group.limitEndTime && dayjs(child.endTime).isAfter(dayjs(group.limitEndTime))) {
12996
+ warning = warning ? warning + "; 结束时间晚于分组限制" : "结束时间晚于分组限制";
12997
+ }
12998
+ if (warning) {
12999
+ return { ...child, warning };
13000
+ }
13001
+ return child;
13002
+ });
13003
+ return {
13004
+ ...group,
13005
+ startTime: calculatedStart,
13006
+ endTime: calculatedEnd,
13007
+ children: childrenWithWarnings,
13008
+ collapsed: collapsedGroups.value.has(group.id)
13009
+ };
13010
+ }
13011
+ return task;
13012
+ });
13013
+ };
13014
+ return process(localTasks.value);
13015
+ });
12965
13016
  const checkActiveTasks = (newTime, oldTime) => {
12966
13017
  if (!newTime)
12967
13018
  return;
@@ -12981,15 +13032,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12981
13032
  left.push({ task, block });
12982
13033
  }
12983
13034
  });
12984
- } else if (task.type === "task" || !task.type) {
13035
+ } else if (task.type === "task" || task.type === "group" || !task.type) {
12985
13036
  if (task.startTime && task.endTime) {
12986
13037
  const inside = newTime >= task.startTime && newTime <= task.endTime;
12987
13038
  if (inside && !activeTaskIds.has(task.id)) {
12988
13039
  activeTaskIds.add(task.id);
12989
- entered.push({ task });
13040
+ if (task.type === "group") {
13041
+ entered.push({ task, group: task });
13042
+ } else {
13043
+ entered.push({ task });
13044
+ }
12990
13045
  } else if (!inside && activeTaskIds.has(task.id)) {
12991
13046
  activeTaskIds.delete(task.id);
12992
- left.push({ task });
13047
+ if (task.type === "group") {
13048
+ left.push({ task, group: task });
13049
+ } else {
13050
+ left.push({ task });
13051
+ }
12993
13052
  }
12994
13053
  }
12995
13054
  }
@@ -13008,7 +13067,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13008
13067
  check(task.children);
13009
13068
  });
13010
13069
  };
13011
- check(localTasks.value);
13070
+ check(tasksWithComputedData.value);
13012
13071
  if (entered.length > 0)
13013
13072
  emit("task-enter", entered);
13014
13073
  if (left.length > 0)
@@ -13034,58 +13093,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13034
13093
  }
13035
13094
  };
13036
13095
  const processedTasks = computed(() => {
13037
- const process = (list) => {
13096
+ const filterCollapsed = (list) => {
13038
13097
  return list.map((task) => {
13039
13098
  if (task.type === "group") {
13040
13099
  const group = task;
13041
- const rawChildren = group.children || [];
13042
- const processedChildren = process(rawChildren);
13043
- let minTime = Number.MAX_SAFE_INTEGER;
13044
- let maxTime = Number.MIN_SAFE_INTEGER;
13045
- if (processedChildren.length > 0) {
13046
- processedChildren.forEach((child) => {
13047
- const start = new Date(child.startTime).getTime();
13048
- const end = new Date(child.endTime).getTime();
13049
- if (!isNaN(start)) {
13050
- if (start < minTime)
13051
- minTime = start;
13052
- }
13053
- if (!isNaN(end)) {
13054
- if (end > maxTime)
13055
- maxTime = end;
13056
- }
13057
- });
13058
- }
13059
- const calculatedStart = minTime !== Number.MAX_SAFE_INTEGER ? new Date(minTime).toISOString() : "";
13060
- const calculatedEnd = maxTime !== Number.MIN_SAFE_INTEGER ? new Date(maxTime).toISOString() : "";
13061
- let displayChildren = processedChildren.map((child) => {
13062
- let warning = void 0;
13063
- if (group.limitStartTime && dayjs(child.startTime).isBefore(dayjs(group.limitStartTime))) {
13064
- warning = "开始时间早于分组限制";
13065
- }
13066
- if (group.limitEndTime && dayjs(child.endTime).isAfter(dayjs(group.limitEndTime))) {
13067
- warning = warning ? warning + "; 结束时间晚于分组限制" : "结束时间晚于分组限制";
13068
- }
13069
- if (warning) {
13070
- return { ...child, warning };
13071
- }
13072
- return child;
13073
- });
13074
13100
  const isCollapsed = collapsedGroups.value.has(group.id);
13075
13101
  return {
13076
13102
  ...group,
13077
- startTime: calculatedStart,
13078
- endTime: calculatedEnd,
13079
- children: isCollapsed ? [] : displayChildren,
13080
- // 如果折叠则隐藏子任务
13081
- collapsed: isCollapsed
13082
- // 传递折叠状态给 UI
13103
+ children: isCollapsed ? [] : filterCollapsed(group.children || [])
13083
13104
  };
13084
13105
  }
13085
13106
  return task;
13086
13107
  });
13087
13108
  };
13088
- return process(localTasks.value);
13109
+ return filterCollapsed(tasksWithComputedData.value);
13089
13110
  });
13090
13111
  const fitToTasks = (tasks) => {
13091
13112
  if (tasks.length === 0)
@@ -13694,8 +13715,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13694
13715
  };
13695
13716
  }
13696
13717
  });
13697
- const CesiumGantt_vue_vue_type_style_index_0_scoped_f03f42e8_lang = "";
13698
- const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f03f42e8"]]);
13718
+ const CesiumGantt_vue_vue_type_style_index_0_scoped_1991ca92_lang = "";
13719
+ const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1991ca92"]]);
13699
13720
  class ViewportRoam {
13700
13721
  constructor(viewer, data, intervals) {
13701
13722
  __publicField(this, "viewer");