@flexem/fc-gui 3.0.0-alpha.134 → 3.0.0-alpha.136

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.
@@ -42600,9 +42600,9 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42600
42600
  this.getAlarmData();
42601
42601
  }
42602
42602
  }
42603
- // 当内容完全滚出容器左侧时(currentLeft + totalWidth < 0
42604
- // 说明所有内容都已经滚出视图,需要重置或停止
42605
- if (this.currentLeft + this.totalWidth < 0) {
42603
+ // 当内容完全滚出容器左侧时(currentLeft + totalWidth < -50
42604
+ // 说明所有内容都已经滚出视图(不开启自动循环时多滚动50px确保最后一个字完全滚出)
42605
+ if (this.currentLeft + this.totalWidth < -50) {
42606
42606
  if (this.autoCycle) {
42607
42607
  // 自动循环模式:无缝衔接回到容器右侧
42608
42608
  if (this.hasMoreData) {
@@ -42853,9 +42853,9 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42853
42853
  this.allAlarmsContainer.style.left = `${this.currentLeft}px`;
42854
42854
  // 当内容完全滚出容器左侧时(内容右边缘完全移出容器左边缘)
42855
42855
  // currentLeft + totalWidth 表示内容右边缘的位置
42856
- // 当这个值 <= 0 时,表示内容右边缘已经到达或超过容器左边缘,内容完全不可见
42856
+ // 当这个值 <= -50 时,表示内容完全不可见(不开启自动循环时多滚动50px确保最后一个字完全滚出)
42857
42857
  const rightEdge = this.currentLeft + this.totalWidth;
42858
- if (rightEdge <= 0) {
42858
+ if (rightEdge <= -50) {
42859
42859
  if (this.autoCycle) {
42860
42860
  // 自动循环模式:重置到容器右侧(使用配置宽度)
42861
42861
  this.currentLeft = this.model.size.width;
@@ -42916,13 +42916,22 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42916
42916
  }
42917
42917
  return;
42918
42918
  }
42919
- // 如果是首次加载或当前没有数据,直接渲染
42919
+ // 如果是首次加载或当前没有数据,直接渲染并启动滚动
42920
42920
  if (this.displayedItems.length === 0) {
42921
42921
  this.displayedItems = newItems;
42922
42922
  this.allAlarmsContainer.innerHTML = '';
42923
42923
  this.totalWidth = 0;
42924
42924
  this.pageWidths = [];
42925
+ // 设置 hasMoreData 状态,防止滚动时误触发 getAlarmData
42926
+ this.hasMoreData = result.totalCount > newItems.length;
42927
+ // 设置初始位置到容器右侧
42928
+ this.currentLeft = this.container.clientWidth;
42929
+ this.allAlarmsContainer.style.left = `${this.currentLeft}px`;
42925
42930
  this.renderNewPage(newItems);
42931
+ // 启动滚动
42932
+ if (!this.isScrolling) {
42933
+ this.initScrolling();
42934
+ }
42926
42935
  return;
42927
42936
  }
42928
42937
  // 保存当前的滚动位置