@flexem/fc-gui 3.0.0-alpha.115 → 3.0.0-alpha.116
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.
- package/bundles/@flexem/fc-gui.umd.js +40 -42
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/base/readable-element.js +20 -1
- package/gui/gui-view.js +20 -41
- package/package.json +1 -1
|
@@ -35328,7 +35328,26 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
|
|
|
35328
35328
|
this.updateVariableValue(value.value, value.variableName);
|
|
35329
35329
|
}
|
|
35330
35330
|
if (value.systemName === '设备状态') {
|
|
35331
|
-
|
|
35331
|
+
let name = value.customStatus;
|
|
35332
|
+
const language = window.abp.localization.currentCulture.name;
|
|
35333
|
+
if (!name) {
|
|
35334
|
+
switch (value.state) {
|
|
35335
|
+
case 1:
|
|
35336
|
+
name = language === 'zh-Hans' ? '在线' : 'Online';
|
|
35337
|
+
break;
|
|
35338
|
+
case 3:
|
|
35339
|
+
name = language === 'zh-Hans' ? '离线' : 'Offline';
|
|
35340
|
+
break;
|
|
35341
|
+
case 4:
|
|
35342
|
+
name = language === 'zh-Hans' ? '告警' : 'Alarming';
|
|
35343
|
+
break;
|
|
35344
|
+
case 5:
|
|
35345
|
+
name = language === 'zh-Hans' ? '未绑定' : 'Unbound';
|
|
35346
|
+
break;
|
|
35347
|
+
default:
|
|
35348
|
+
}
|
|
35349
|
+
}
|
|
35350
|
+
this.updateVariableValue(name, '设备状态');
|
|
35332
35351
|
}
|
|
35333
35352
|
}
|
|
35334
35353
|
}
|
|
@@ -41806,50 +41825,29 @@ class gui_view_GuiView {
|
|
|
41806
41825
|
if (this.requestVirtualDeviceState) {
|
|
41807
41826
|
this.requestVirtualDeviceState.unsubscribe();
|
|
41808
41827
|
}
|
|
41809
|
-
|
|
41810
|
-
|
|
41811
|
-
this.requestVirtualDeviceState
|
|
41812
|
-
|
|
41813
|
-
|
|
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
|
-
}
|
|
41828
|
+
this.normalOpenedVariableNames(['设备状态']);
|
|
41829
|
+
this.requestVirtualDeviceState =
|
|
41830
|
+
this.perViewVariableCommunicator.requestVirtualDeviceState().subscribe({
|
|
41831
|
+
complete: () => { }
|
|
41832
|
+
});
|
|
41833
|
+
this.openedVariableNames = this.openedVariableNames.filter(name => name !== '设备状态');
|
|
41834
41834
|
}
|
|
41835
|
-
|
|
41836
|
-
|
|
41837
|
-
|
|
41838
|
-
|
|
41839
|
-
this.
|
|
41840
|
-
this.
|
|
41841
|
-
|
|
41842
|
-
|
|
41843
|
-
|
|
41844
|
-
|
|
41845
|
-
normalVariableNames.push(v.variableName);
|
|
41846
|
-
}
|
|
41847
|
-
});
|
|
41848
|
-
if (normalVariableNames.length > 0) {
|
|
41849
|
-
this.normalOpenedVariableNames(normalVariableNames);
|
|
41835
|
+
if (this.openedVariableNames.length === 0) {
|
|
41836
|
+
return;
|
|
41837
|
+
}
|
|
41838
|
+
this.openVariableStatesSubscription =
|
|
41839
|
+
this.perViewVariableCommunicator.subscribeVariableStates(this.openedVariableNames).subscribe((states) => {
|
|
41840
|
+
this.mainElement.reportVariableStates(states);
|
|
41841
|
+
const normalVariableNames = [];
|
|
41842
|
+
Object(lodash["each"])(states, v => {
|
|
41843
|
+
if (v.state === communication["d" /* VariableStateEnum */].Normal && normalVariableNames.indexOf(v.variableName) === -1) {
|
|
41844
|
+
normalVariableNames.push(v.variableName);
|
|
41850
41845
|
}
|
|
41851
41846
|
});
|
|
41852
|
-
|
|
41847
|
+
if (normalVariableNames.length > 0) {
|
|
41848
|
+
this.normalOpenedVariableNames(normalVariableNames);
|
|
41849
|
+
}
|
|
41850
|
+
});
|
|
41853
41851
|
}
|
|
41854
41852
|
popView(viewIndex, hostContainerId, el) {
|
|
41855
41853
|
return this.context.configStore.viewStore.getViewConfig(viewIndex).pipe(Object(operators_["map"])(view => {
|