@flexem/fc-gui 3.0.0-alpha.140 → 3.0.0-alpha.142

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.
@@ -37165,9 +37165,11 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37165
37165
  this.displayOption.operationButtonMargin = 6;
37166
37166
  }
37167
37167
  }
37168
+ // 初始化时间段数据(此时文本库可能未加载,先填充空文本占位)
37169
+ this.timePeriods = this.getValidTimePeriods();
37168
37170
  this.loadFirstPage();
37169
37171
  this.initKeyboardListener();
37170
- // 订阅语种变化事件
37172
+ // 订阅语种变化事件 和 文本库缓存更新事件
37171
37173
  this.subscribeLanguageChange();
37172
37174
  }
37173
37175
  dispose() {
@@ -37200,12 +37202,25 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
37200
37202
  * 订阅语种变化事件
37201
37203
  */
37202
37204
  subscribeLanguageChange() {
37205
+ var _a;
37203
37206
  if (this.guiContext && this.guiContext.languageChanged$) {
37204
37207
  this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
37205
37208
  // 只更新时间段选择器的文案,不重新查询数据
37206
37209
  this.updateLanguageTexts();
37207
37210
  });
37208
37211
  }
37212
+ // 订阅文本库缓存更新事件,解决首次加载时文本库未就绪导致下拉选项为空的问题
37213
+ if ((_a = this.systemTextLibraryService) === null || _a === void 0 ? void 0 : _a.cacheUpdated) {
37214
+ const cacheSubscription = this.systemTextLibraryService.cacheUpdated.subscribe(() => {
37215
+ this.updateLanguageTexts();
37216
+ });
37217
+ if (this.languageChangeSubscription) {
37218
+ this.languageChangeSubscription.add(cacheSubscription);
37219
+ }
37220
+ else {
37221
+ this.languageChangeSubscription = cacheSubscription;
37222
+ }
37223
+ }
37209
37224
  }
37210
37225
  /**
37211
37226
  * 更新语种相关的文案(时间段选择器)
@@ -41067,8 +41082,10 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41067
41082
  this.svgRootClass = svgRootClass;
41068
41083
  this.videoId = '';
41069
41084
  this.isFullscreen = false;
41085
+ this.lastTimeUpdate = 0;
41070
41086
  this.isMobileMode = _tmp_settings["a" /* DisplayMode */].Mobile === injector.get(_tmp_settings["b" /* GlobalSettings */]).displayMode;
41071
41087
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
41088
+ this.initVisibilityHandler();
41072
41089
  this.init();
41073
41090
  }
41074
41091
  dispose() {
@@ -41078,6 +41095,10 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41078
41095
  $('div.' + this.svgRootClass + ' video').each(function () {
41079
41096
  $(this).remove();
41080
41097
  });
41098
+ if (this.visibilityChangeHandler) {
41099
+ document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
41100
+ }
41101
+ this.clearTimeUpdateWatchdog();
41081
41102
  }
41082
41103
  hide() {
41083
41104
  super.hide();
@@ -41176,6 +41197,7 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41176
41197
  this.videoPlayer.play();
41177
41198
  });
41178
41199
  }
41200
+ this.startTimeUpdateWatchdog(videoId);
41179
41201
  }
41180
41202
  catch (err) {
41181
41203
  console.log(err);
@@ -41261,6 +41283,37 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41261
41283
  }
41262
41284
  });
41263
41285
  }
41286
+ initVisibilityHandler() {
41287
+ this.visibilityChangeHandler = () => {
41288
+ if (!document.hidden && this.videoUrl && this.videoId) {
41289
+ this.initVideo(this.videoUrl, this.videoId);
41290
+ }
41291
+ };
41292
+ document.addEventListener('visibilitychange', this.visibilityChangeHandler);
41293
+ }
41294
+ startTimeUpdateWatchdog(videoId) {
41295
+ this.clearTimeUpdateWatchdog();
41296
+ this.lastTimeUpdate = Date.now();
41297
+ const videoEl = document.getElementById(videoId);
41298
+ if (videoEl && videoEl.tagName === 'VIDEO') {
41299
+ videoEl.addEventListener('timeupdate', () => {
41300
+ this.lastTimeUpdate = Date.now();
41301
+ });
41302
+ }
41303
+ this.timeUpdateWatchdog = setInterval(() => {
41304
+ if (document.hidden)
41305
+ return;
41306
+ if (Date.now() - this.lastTimeUpdate > 30000) {
41307
+ this.initVideo(this.videoUrl, this.videoId);
41308
+ }
41309
+ }, 30000);
41310
+ }
41311
+ clearTimeUpdateWatchdog() {
41312
+ if (this.timeUpdateWatchdog) {
41313
+ clearInterval(this.timeUpdateWatchdog);
41314
+ this.timeUpdateWatchdog = null;
41315
+ }
41316
+ }
41264
41317
  setIosVideo(videoUrl, videoId) {
41265
41318
  const video = $('#' + this.videoId);
41266
41319
  video.on('webkitendfullscreen', () => {
@@ -42479,7 +42532,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42479
42532
  this.container = document.createElement('div');
42480
42533
  this.container.style.cssText = `
42481
42534
  height: ${elementHeight}px;
42482
- width: 100%;
42535
+ width: ${elementWidth}px;
42483
42536
  background-color: ${((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.headerFillColor) || '#ffffff'};
42484
42537
  display: flex;
42485
42538
  align-items: center;
@@ -42490,11 +42543,11 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42490
42543
  `;
42491
42544
  this.element.appendChild(this.container);
42492
42545
  // 创建一个大容器来包含所有告警项,初始位置在容器右侧(从右边开始滚入)
42546
+ // 使用 position: relative 而非 absolute,避免 iOS Safari foreignObject 内 absolute 定位逃逸到页面左上角的 bug
42493
42547
  this.allAlarmsContainer = document.createElement('div');
42494
42548
  this.allAlarmsContainer.style.cssText = `
42495
- position: absolute;
42496
- top: 50%;
42497
- transform: translateY(-50%);
42549
+ position: relative;
42550
+ flex-shrink: 0;
42498
42551
  display: flex;
42499
42552
  align-items: center;
42500
42553
  gap: 80px;