@flexem/fc-gui 3.0.0-alpha.154 → 3.0.0-alpha.156
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 +14 -8
- 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/modal/write-value/write-value-modal.component.js +2 -2
- package/package.json +1 -1
- package/remote/communication/variable/remote-variable-communicator.js +12 -6
|
@@ -36,11 +36,11 @@ let WriteValueModalComponent = class WriteValueModalComponent {
|
|
|
36
36
|
this.validate();
|
|
37
37
|
}
|
|
38
38
|
initData(option) {
|
|
39
|
-
var _a, _b, _c;
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
40
|
this.variableName = option.variableName;
|
|
41
41
|
this.displayVariableName = this.variableName;
|
|
42
42
|
if (this.variableName === '当前语种ID') {
|
|
43
|
-
const language = (_c = (_b = (_a = window.abp) === null || _a === void 0 ? void 0 : _a.localization) === null || _b === void 0 ? void 0 : _b.currentLanguage) === null || _c === void 0 ? void 0 : _c.name;
|
|
43
|
+
const language = ((_c = (_b = (_a = window.abp) === null || _a === void 0 ? void 0 : _a.localization) === null || _b === void 0 ? void 0 : _b.currentLanguage) === null || _c === void 0 ? void 0 : _c.name) || ((_e = (_d = this.localization.localizationService) === null || _d === void 0 ? void 0 : _d.translate) === null || _e === void 0 ? void 0 : _e.currentLang);
|
|
44
44
|
const isTraditionalChinese = language === 'zh-Hant' || language === 'zh-TW' || language === 'zh-tw';
|
|
45
45
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
46
46
|
if (isTraditionalChinese) {
|
package/package.json
CHANGED
|
@@ -94,10 +94,18 @@ export class RemoteVariableCommunicator {
|
|
|
94
94
|
ob.next([state]);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
//
|
|
98
|
-
if (GuiFeatureConfig.isOfflineDisplayEnabled && state.state === VariableStateEnum.Offline
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
// 离线时推送最后已知值给值订阅者
|
|
98
|
+
if (GuiFeatureConfig.isOfflineDisplayEnabled && state.state === VariableStateEnum.Offline) {
|
|
99
|
+
let cachedValue;
|
|
100
|
+
// 优先用最后一次收到的值(可能是在线时推送的),覆盖所有切页/重连场景
|
|
101
|
+
if (this.variableValueCache.has(variableName)) {
|
|
102
|
+
cachedValue = this.variableValueCache.get(variableName).value;
|
|
103
|
+
}
|
|
104
|
+
else if (this.offlineValueCache.has(variableName)) {
|
|
105
|
+
// 兜底:变量从未收到过值,用预加载的离线值
|
|
106
|
+
cachedValue = this.offlineValueCache.get(variableName);
|
|
107
|
+
}
|
|
108
|
+
if (cachedValue !== null && cachedValue !== undefined) {
|
|
101
109
|
const variableValue = {
|
|
102
110
|
variableName,
|
|
103
111
|
value: cachedValue,
|
|
@@ -111,8 +119,6 @@ export class RemoteVariableCommunicator {
|
|
|
111
119
|
}
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
|
-
// 无论什么状态,推送后清除缓存,防止后续再次离线时用旧值
|
|
115
|
-
this.offlineValueCache.delete(variableName);
|
|
116
122
|
});
|
|
117
123
|
});
|
|
118
124
|
}
|