@flexem/fc-gui 3.0.0-alpha.115 → 3.0.0-alpha.117

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.
@@ -35316,6 +35316,7 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35316
35316
  });
35317
35317
  }
35318
35318
  reportValueChanged(value) {
35319
+ var _a, _b, _c, _d;
35319
35320
  Object(lodash["forEach"])(this.elementStates, elementState => {
35320
35321
  if (elementState.variableName === value.variableName || elementState.variableName === value.systemName) {
35321
35322
  elementState.state = value.state;
@@ -35328,7 +35329,27 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
35328
35329
  this.updateVariableValue(value.value, value.variableName);
35329
35330
  }
35330
35331
  if (value.systemName === '设备状态') {
35331
- this.updateVariableValue(value.customStatus, '设备状态');
35332
+ let name = value.customStatus;
35333
+ const language = ((_b = (_a = window.abp.localization) === null || _a === void 0 ? void 0 : _a.currentCulture) === null || _b === void 0 ? void 0 : _b.name) || ((_d = (_c = this.localization.localizationService) === null || _c === void 0 ? void 0 : _c.translate) === null || _d === void 0 ? void 0 : _d.currentLang);
35334
+ const isChinese = language === 'zh-Hans' || language === 'zh';
35335
+ if (!name) {
35336
+ switch (value.state) {
35337
+ case 1:
35338
+ name = isChinese ? '在线' : 'Online';
35339
+ break;
35340
+ case 3:
35341
+ name = isChinese ? '离线' : 'Offline';
35342
+ break;
35343
+ case 4:
35344
+ name = isChinese ? '告警' : 'Alarming';
35345
+ break;
35346
+ case 5:
35347
+ name = isChinese ? '未绑定' : 'Unbound';
35348
+ break;
35349
+ default:
35350
+ }
35351
+ }
35352
+ this.updateVariableValue(name, '设备状态');
35332
35353
  }
35333
35354
  }
35334
35355
  }
@@ -41806,50 +41827,29 @@ class gui_view_GuiView {
41806
41827
  if (this.requestVirtualDeviceState) {
41807
41828
  this.requestVirtualDeviceState.unsubscribe();
41808
41829
  }
41809
- if (this.openedVariableNames.length === 1) {
41810
- this.normalOpenedVariableNames(['设备状态']);
41811
- this.requestVirtualDeviceState =
41812
- this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
41813
- complete: () => { }
41814
- });
41815
- }
41816
- else {
41817
- this.openVariableStatesSubscription =
41818
- this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
41819
- this.mainElement.reportVariableStates(states);
41820
- const normalVariableNames = [];
41821
- Object(lodash["each"])(states, v => {
41822
- if (v.state === communication["d" /* VariableStateEnum */].Normal && normalVariableNames.indexOf(v.variableName) === -1) {
41823
- normalVariableNames.push(v.variableName);
41824
- }
41825
- });
41826
- normalVariableNames.push('设备状态');
41827
- this.normalOpenedVariableNames(normalVariableNames);
41828
- this.requestVirtualDeviceState =
41829
- this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
41830
- complete: () => { }
41831
- });
41832
- });
41833
- }
41830
+ this.normalOpenedVariableNames(['设备状态']);
41831
+ this.requestVirtualDeviceState =
41832
+ this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
41833
+ complete: () => { }
41834
+ });
41835
+ this.openedVariableNames = this.openedVariableNames.filter(name => name !== '设备状态');
41834
41836
  }
41835
- else {
41836
- if (this.openedVariableNames.length === 0) {
41837
- return;
41838
- }
41839
- this.openVariableStatesSubscription =
41840
- this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
41841
- this.mainElement.reportVariableStates(states);
41842
- const normalVariableNames = [];
41843
- Object(lodash["each"])(states, v => {
41844
- if (v.state === communication["d" /* VariableStateEnum */].Normal && normalVariableNames.indexOf(v.variableName) === -1) {
41845
- normalVariableNames.push(v.variableName);
41846
- }
41847
- });
41848
- if (normalVariableNames.length > 0) {
41849
- this.normalOpenedVariableNames(normalVariableNames);
41837
+ if (this.openedVariableNames.length === 0) {
41838
+ return;
41839
+ }
41840
+ this.openVariableStatesSubscription =
41841
+ this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
41842
+ this.mainElement.reportVariableStates(states);
41843
+ const normalVariableNames = [];
41844
+ Object(lodash["each"])(states, v => {
41845
+ if (v.state === communication["d" /* VariableStateEnum */].Normal && normalVariableNames.indexOf(v.variableName) === -1) {
41846
+ normalVariableNames.push(v.variableName);
41850
41847
  }
41851
41848
  });
41852
- }
41849
+ if (normalVariableNames.length > 0) {
41850
+ this.normalOpenedVariableNames(normalVariableNames);
41851
+ }
41852
+ });
41853
41853
  }
41854
41854
  popView(viewIndex, hostContainerId, el) {
41855
41855
  return this.context.configStore.viewStore.getViewConfig(viewIndex).pipe(Object(operators_["map"])(view => {