@flexem/fc-gui 3.0.0-alpha.120 → 3.0.0-alpha.122

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.
@@ -36229,6 +36229,24 @@ class graph_state_element_GraphStateElement {
36229
36229
  }
36230
36230
  }
36231
36231
  }
36232
+ dispose() {
36233
+ // 清理定时器
36234
+ if (this.faultFlickerInterval) {
36235
+ clearInterval(this.faultFlickerInterval);
36236
+ this.faultFlickerInterval = undefined;
36237
+ }
36238
+ // 移除图片元素
36239
+ this.removeImageElement();
36240
+ // 清理图形缓存
36241
+ if (this.graphs) {
36242
+ this.graphs.clear();
36243
+ }
36244
+ // 清理 SVG 元素
36245
+ if (this._element && this._element.parentNode) {
36246
+ this._element.parentNode.removeChild(this._element);
36247
+ }
36248
+ this._element = null;
36249
+ }
36232
36250
  }
36233
36251
 
36234
36252
  // CONCATENATED MODULE: ./.tmp/elements/datetime-display/time-zone-select-json.ts
@@ -39566,7 +39584,7 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
39566
39584
  default:
39567
39585
  throw new Error(`Unknown switchType:${settings.type}`);
39568
39586
  }
39569
- this.indicatorLightOperator.currentStateIdChanged.subscribe(statusIdValue => {
39587
+ this.indicatorLightSubscription = this.indicatorLightOperator.currentStateIdChanged.subscribe(statusIdValue => {
39570
39588
  this.currentStateIdChange(statusIdValue);
39571
39589
  });
39572
39590
  this.indicatorLightOperator.requestData(this.signalRAppId);
@@ -39607,6 +39625,30 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
39607
39625
  throw new Error('The switch indicator light\'s states must greater than 2.');
39608
39626
  }
39609
39627
  }
39628
+ dispose() {
39629
+ // 清理 document 级别的事件监听器
39630
+ if (this.onDocMouseUp) {
39631
+ document.removeEventListener(this.isMobileMode ? 'touchend' : 'mouseup', this.onDocMouseUp);
39632
+ }
39633
+ // 清理定时器
39634
+ if (this.restorationTimer) {
39635
+ clearTimeout(this.restorationTimer);
39636
+ this.restorationTimer = undefined;
39637
+ }
39638
+ // 清理 indicatorLightOperator 订阅
39639
+ if (this.indicatorLightSubscription) {
39640
+ this.indicatorLightSubscription.unsubscribe();
39641
+ }
39642
+ // 清理图形元素(释放 SVG 内存)
39643
+ if (this.graphStateElement) {
39644
+ this.graphStateElement.dispose();
39645
+ }
39646
+ // 清理文本元素
39647
+ if (this.textStateElement) {
39648
+ // TextStateElement 可能也需要 dispose,暂时先清理引用
39649
+ this.textStateElement = null;
39650
+ }
39651
+ }
39610
39652
  }
39611
39653
 
39612
39654
  // CONCATENATED MODULE: ./.tmp/elements/vector-graphics/ellipse-element.ts
@@ -41632,7 +41674,7 @@ class main_element_MainElement {
41632
41674
  Object(lodash["each"])(this.elements, e => {
41633
41675
  if (e instanceof historical_curve_element_HistoricalCurveElement || e instanceof video_element_VideoElement
41634
41676
  || e instanceof weater_element_WeatherElement || e instanceof numerical_display_element_NumericalDisplayElement || e instanceof text_element_TextElement
41635
- || e instanceof air_quality_element_AirQualityElement) {
41677
+ || e instanceof air_quality_element_AirQualityElement || e instanceof switch_indicator_light_element_SwitchIndicatorLightElement) {
41636
41678
  e.dispose();
41637
41679
  }
41638
41680
  });