@flexem/fc-gui 3.0.0-alpha.176 → 3.0.0-alpha.178
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 +36 -18
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/base/readable-element.js +4 -1
- package/elements/historical-curve/historical-curve.element.js +12 -1
- package/elements/scroll-alarm/scroll-alarm-element.d.ts +1 -0
- package/elements/scroll-alarm/scroll-alarm-element.js +16 -14
- package/elements/scroll-alarm/scroll-alarm-element.metadata.json +1 -1
- package/localization/localization.service.d.ts +1 -0
- package/localization/localization.service.js +3 -2
- package/localization/localization.service.metadata.json +1 -1
- package/localization/localization.service.zh_CN.js +1 -0
- package/localization/localization.service.zh_CN.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -22319,6 +22319,7 @@ const Localization_zh_CN = {
|
|
|
22319
22319
|
loadFailed: '加载失败.',
|
|
22320
22320
|
setting: '设置',
|
|
22321
22321
|
submit: '提交',
|
|
22322
|
+
save: '保存',
|
|
22322
22323
|
submitting: '提交中···',
|
|
22323
22324
|
numericalValueRequired: '数值不能为空',
|
|
22324
22325
|
invalidNumericalValue: '数值格式不正确',
|
|
@@ -32518,7 +32519,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;!function() {
|
|
|
32518
32519
|
const LOCALIZATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('fc.gui.loc');
|
|
32519
32520
|
const DefaultLocalization = {
|
|
32520
32521
|
loadFailed: 'Load failed.',
|
|
32521
|
-
setting: 'Setting',
|
|
32522
|
+
setting: 'Setting ',
|
|
32523
|
+
save: 'Save',
|
|
32522
32524
|
submit: 'Submit',
|
|
32523
32525
|
submitting: 'Submitting···',
|
|
32524
32526
|
numericalValueRequired: 'Numerical value can\'t be emtpy',
|
|
@@ -32563,7 +32565,7 @@ const DefaultLocalization = {
|
|
|
32563
32565
|
endTime: 'End Time',
|
|
32564
32566
|
grouped: 'Grouped',
|
|
32565
32567
|
stacked: 'Stacked',
|
|
32566
|
-
passwordVerify: 'Password
|
|
32568
|
+
passwordVerify: 'Password Verification',
|
|
32567
32569
|
passwordError: 'Password error',
|
|
32568
32570
|
password: 'Password',
|
|
32569
32571
|
passwordToolTip: 'Password error, please re-enter',
|
|
@@ -35433,7 +35435,7 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
|
|
|
35433
35435
|
name = isTraditionalChinese ? '離線' : (isChinese ? '离线' : 'Offline');
|
|
35434
35436
|
break;
|
|
35435
35437
|
case 4:
|
|
35436
|
-
name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : '
|
|
35438
|
+
name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
|
|
35437
35439
|
break;
|
|
35438
35440
|
case 5:
|
|
35439
35441
|
name = isTraditionalChinese ? '未綁定' : (isChinese ? '未绑定' : 'Unbound');
|
|
@@ -35441,6 +35443,9 @@ class readable_element_ReadableElement extends conditional_enable_element_Condit
|
|
|
35441
35443
|
default:
|
|
35442
35444
|
}
|
|
35443
35445
|
}
|
|
35446
|
+
if (value.state === 4) {
|
|
35447
|
+
name = isTraditionalChinese ? '告警' : (isChinese ? '告警' : 'Alarm');
|
|
35448
|
+
}
|
|
35444
35449
|
this.updateVariableValue(name, '设备状态');
|
|
35445
35450
|
return; // 处理完"设备状态"后直接返回
|
|
35446
35451
|
}
|
|
@@ -37962,8 +37967,15 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37962
37967
|
: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0));
|
|
37963
37968
|
const defaultEnd = this.fmtDatetimeLocal(this.customEndTime ? this.customEndTime.toDate()
|
|
37964
37969
|
: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59));
|
|
37970
|
+
// 临时将 <html lang> 切换为当前应用语言,使原生 datetime-local
|
|
37971
|
+
// 弹出日历的 UI(星期/月份文字等)跟随应用语种显示,关闭时还原
|
|
37972
|
+
const currentLang = this.getCurrentCulture();
|
|
37973
|
+
const prevDocLang = document.documentElement.lang;
|
|
37974
|
+
document.documentElement.lang = currentLang;
|
|
37965
37975
|
const overlay = document.createElement('div');
|
|
37966
37976
|
overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;';
|
|
37977
|
+
// 部分浏览器可直接读取元素上的 lang 属性来本地化原生控件
|
|
37978
|
+
overlay.lang = currentLang;
|
|
37967
37979
|
const modal = document.createElement('div');
|
|
37968
37980
|
let modalCss = 'position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);'
|
|
37969
37981
|
+ 'background:#fff;border-radius:4px;';
|
|
@@ -37979,7 +37991,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37979
37991
|
header.style.cssText = 'display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #e8e8e8;';
|
|
37980
37992
|
const title = document.createElement('span');
|
|
37981
37993
|
title.style.cssText = 'font-size:16px;font-weight:500;color:#333;';
|
|
37982
|
-
title.textContent = this.
|
|
37994
|
+
title.textContent = this.localization.customTimeRange;
|
|
37983
37995
|
const closeBtn = document.createElement('span');
|
|
37984
37996
|
closeBtn.style.cssText = 'cursor:pointer;font-size:18px;color:#999;line-height:1;';
|
|
37985
37997
|
closeBtn.textContent = '×';
|
|
@@ -37994,6 +38006,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37994
38006
|
const startInput = document.createElement('input');
|
|
37995
38007
|
startInput.type = 'datetime-local';
|
|
37996
38008
|
startInput.setAttribute('step', '1');
|
|
38009
|
+
startInput.setAttribute('lang', currentLang);
|
|
37997
38010
|
startInput.value = defaultStart;
|
|
37998
38011
|
startInput.style.cssText = inputStyle;
|
|
37999
38012
|
const separator = document.createElement('span');
|
|
@@ -38002,6 +38015,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
38002
38015
|
const endInput = document.createElement('input');
|
|
38003
38016
|
endInput.type = 'datetime-local';
|
|
38004
38017
|
endInput.setAttribute('step', '1');
|
|
38018
|
+
endInput.setAttribute('lang', currentLang);
|
|
38005
38019
|
endInput.value = defaultEnd;
|
|
38006
38020
|
endInput.style.cssText = inputStyle;
|
|
38007
38021
|
body.appendChild(label);
|
|
@@ -38024,6 +38038,8 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
38024
38038
|
overlay.appendChild(modal);
|
|
38025
38039
|
document.body.appendChild(overlay);
|
|
38026
38040
|
const close = (revert) => {
|
|
38041
|
+
// 还原弹窗打开前的 <html lang>,避免影响页面其他部分
|
|
38042
|
+
document.documentElement.lang = prevDocLang;
|
|
38027
38043
|
document.body.removeChild(overlay);
|
|
38028
38044
|
if (revert) {
|
|
38029
38045
|
const selectEl = this.$element && this.$element.find('select');
|
|
@@ -42868,6 +42884,7 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
|
|
|
42868
42884
|
|
|
42869
42885
|
|
|
42870
42886
|
|
|
42887
|
+
|
|
42871
42888
|
var ScrollAlarmElementStatus;
|
|
42872
42889
|
(function (ScrollAlarmElementStatus) {
|
|
42873
42890
|
ScrollAlarmElementStatus[ScrollAlarmElementStatus["Normal"] = 0] = "Normal";
|
|
@@ -42900,6 +42917,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
42900
42917
|
this.rootElement.selectAll('*').remove();
|
|
42901
42918
|
this.setStatusAsLoading();
|
|
42902
42919
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
42920
|
+
this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
|
|
42903
42921
|
this.variableCommunicator = variableCommunicator;
|
|
42904
42922
|
this.autoCycle = (_b = (_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.autoCycle) !== null && _b !== void 0 ? _b : true;
|
|
42905
42923
|
this.maxResultCount = (_d = (_c = this.model.generalSetting) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 500;
|
|
@@ -43230,24 +43248,24 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
43230
43248
|
// 新页的起始 x = 已有总宽度 + gap(如果已有内容)
|
|
43231
43249
|
let xOffset = this.totalWidth > 0 ? this.totalWidth + GAP : 0;
|
|
43232
43250
|
pageData.forEach((alarm) => {
|
|
43233
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
43251
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43234
43252
|
const contentParts = [];
|
|
43235
43253
|
if (((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.showTriggerTime) && alarm.triggeredTime) {
|
|
43236
43254
|
contentParts.push(moment(alarm.triggeredTime).format('YYYY/MM/DD HH:mm:ss'));
|
|
43237
43255
|
}
|
|
43238
|
-
const language = ((_d = (_c = (_b = window.abp) === null || _b === void 0 ? void 0 : _b.localization) === null || _c === void 0 ? void 0 : _c.currentLanguage) === null || _d === void 0 ? void 0 : _d.name) ||
|
|
43256
|
+
const language = ((_d = (_c = (_b = window.abp) === null || _b === void 0 ? void 0 : _b.localization) === null || _c === void 0 ? void 0 : _c.currentLanguage) === null || _d === void 0 ? void 0 : _d.name) || ((_f = (_e = this.localization.localizationService) === null || _e === void 0 ? void 0 : _e.translate) === null || _f === void 0 ? void 0 : _f.currentLang);
|
|
43239
43257
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
43240
|
-
if (((
|
|
43258
|
+
if (((_g = this.model.generalSetting) === null || _g === void 0 ? void 0 : _g.showAlarmLevel) && alarm.alarmLevel !== undefined) {
|
|
43241
43259
|
const levelMap = isChinese ? ['警告', '次要', '主要', '严重'] : ['Warning', 'Minor', 'Major', 'Critical'];
|
|
43242
43260
|
contentParts.push(levelMap[alarm.alarmLevel] || (isChinese ? '警告' : 'Warning'));
|
|
43243
43261
|
}
|
|
43244
|
-
if (((
|
|
43262
|
+
if (((_h = this.model.generalSetting) === null || _h === void 0 ? void 0 : _h.showAlarmName) && alarm.name) {
|
|
43245
43263
|
contentParts.push(alarm.name);
|
|
43246
43264
|
}
|
|
43247
|
-
if (((
|
|
43265
|
+
if (((_j = this.model.generalSetting) === null || _j === void 0 ? void 0 : _j.showAlarmContent) && alarm.message) {
|
|
43248
43266
|
contentParts.push(alarm.message);
|
|
43249
43267
|
}
|
|
43250
|
-
if (((
|
|
43268
|
+
if (((_k = this.model.generalSetting) === null || _k === void 0 ? void 0 : _k.showAlarmState) && alarm.state !== undefined) {
|
|
43251
43269
|
const stateMap = isChinese
|
|
43252
43270
|
? ['触发/未确认', '触发/已确认', '恢复/未确认', '恢复/已确认']
|
|
43253
43271
|
: ['Triggered/Unconfirmed', 'Triggered/Confirmed', 'Restored/Unconfirmed', 'Restored/Confirmed'];
|
|
@@ -43472,7 +43490,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
43472
43490
|
* 模拟运行时的静态显示逻辑:只显示字段标签,不查询数据
|
|
43473
43491
|
*/
|
|
43474
43492
|
renderStaticDisplay() {
|
|
43475
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
43493
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
43476
43494
|
// 根据配置构建显示的字段标签
|
|
43477
43495
|
const textParts = [];
|
|
43478
43496
|
if (((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.showTriggerTime) !== false) {
|
|
@@ -43482,25 +43500,25 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
43482
43500
|
}
|
|
43483
43501
|
if (((_b = this.model.generalSetting) === null || _b === void 0 ? void 0 : _b.showAlarmLevel) !== false) {
|
|
43484
43502
|
// 获取当前语言环境
|
|
43485
|
-
const language = ((_e = (_d = (_c = window.abp) === null || _c === void 0 ? void 0 : _c.localization) === null || _d === void 0 ? void 0 : _d.currentLanguage) === null || _e === void 0 ? void 0 : _e.name) ||
|
|
43503
|
+
const language = ((_e = (_d = (_c = window.abp) === null || _c === void 0 ? void 0 : _c.localization) === null || _d === void 0 ? void 0 : _d.currentLanguage) === null || _e === void 0 ? void 0 : _e.name) || ((_g = (_f = this.localization.localizationService) === null || _f === void 0 ? void 0 : _f.translate) === null || _g === void 0 ? void 0 : _g.currentLang);
|
|
43486
43504
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
43487
43505
|
textParts.push(isChinese ? '严重' : 'Critical');
|
|
43488
43506
|
}
|
|
43489
|
-
if (((
|
|
43507
|
+
if (((_h = this.model.generalSetting) === null || _h === void 0 ? void 0 : _h.showAlarmName) === true) {
|
|
43490
43508
|
// 获取当前语言环境
|
|
43491
|
-
const language = ((
|
|
43509
|
+
const language = ((_l = (_k = (_j = window.abp) === null || _j === void 0 ? void 0 : _j.localization) === null || _k === void 0 ? void 0 : _k.currentLanguage) === null || _l === void 0 ? void 0 : _l.name) || ((_o = (_m = this.localization.localizationService) === null || _m === void 0 ? void 0 : _m.translate) === null || _o === void 0 ? void 0 : _o.currentLang);
|
|
43492
43510
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
43493
43511
|
textParts.push(isChinese ? '室内温度' : 'Indoor Temperature');
|
|
43494
43512
|
}
|
|
43495
|
-
if (((
|
|
43513
|
+
if (((_p = this.model.generalSetting) === null || _p === void 0 ? void 0 : _p.showAlarmContent) !== false) {
|
|
43496
43514
|
// 获取当前语言环境
|
|
43497
|
-
const language = ((
|
|
43515
|
+
const language = ((_s = (_r = (_q = window.abp) === null || _q === void 0 ? void 0 : _q.localization) === null || _r === void 0 ? void 0 : _r.currentLanguage) === null || _s === void 0 ? void 0 : _s.name) || ((_u = (_t = this.localization.localizationService) === null || _t === void 0 ? void 0 : _t.translate) === null || _u === void 0 ? void 0 : _u.currentLang);
|
|
43498
43516
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
43499
43517
|
textParts.push(isChinese ? '室内温度高于30°C或小于10°C' : 'Indoor temperature is higher than 30℃ or lower than 10℃');
|
|
43500
43518
|
}
|
|
43501
|
-
if (((
|
|
43519
|
+
if (((_v = this.model.generalSetting) === null || _v === void 0 ? void 0 : _v.showAlarmState) === true) {
|
|
43502
43520
|
// 获取当前语言环境
|
|
43503
|
-
const language = ((
|
|
43521
|
+
const language = ((_y = (_x = (_w = window.abp) === null || _w === void 0 ? void 0 : _w.localization) === null || _x === void 0 ? void 0 : _x.currentLanguage) === null || _y === void 0 ? void 0 : _y.name) || ((_0 = (_z = this.localization.localizationService) === null || _z === void 0 ? void 0 : _z.translate) === null || _0 === void 0 ? void 0 : _0.currentLang);
|
|
43504
43522
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
43505
43523
|
textParts.push(isChinese ? '触发/未确认' : 'Triggered/Unconfirmed');
|
|
43506
43524
|
}
|