@flexem/fc-gui 3.0.0-alpha.177 → 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 +16 -14
- 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/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/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare class ScrollAlarmElement extends ConditionalDynamicDisplayElement
|
|
|
8
8
|
private readonly alarmsStore;
|
|
9
9
|
readonly model: ScrollAlarmModel;
|
|
10
10
|
private readonly logger;
|
|
11
|
+
private readonly localization;
|
|
11
12
|
readonly variableCommunicator: VariableCommunicator;
|
|
12
13
|
private elementStatus;
|
|
13
14
|
private element;
|
|
@@ -2,6 +2,7 @@ import { ConditionalDynamicDisplayElement } from '../base/conditional-dynamic-di
|
|
|
2
2
|
import { GetAlarmsArgs } from '../../config';
|
|
3
3
|
import * as moment from 'moment';
|
|
4
4
|
import { LOGGER_SERVICE_TOKEN } from '../../logger';
|
|
5
|
+
import { LOCALIZATION } from '../../localization';
|
|
5
6
|
var ScrollAlarmElementStatus;
|
|
6
7
|
(function (ScrollAlarmElementStatus) {
|
|
7
8
|
ScrollAlarmElementStatus[ScrollAlarmElementStatus["Normal"] = 0] = "Normal";
|
|
@@ -34,6 +35,7 @@ export class ScrollAlarmElement extends ConditionalDynamicDisplayElement {
|
|
|
34
35
|
this.rootElement.selectAll('*').remove();
|
|
35
36
|
this.setStatusAsLoading();
|
|
36
37
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
38
|
+
this.localization = injector.get(LOCALIZATION);
|
|
37
39
|
this.variableCommunicator = variableCommunicator;
|
|
38
40
|
this.autoCycle = (_b = (_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.autoCycle) !== null && _b !== void 0 ? _b : true;
|
|
39
41
|
this.maxResultCount = (_d = (_c = this.model.generalSetting) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 500;
|
|
@@ -364,24 +366,24 @@ export class ScrollAlarmElement extends ConditionalDynamicDisplayElement {
|
|
|
364
366
|
// 新页的起始 x = 已有总宽度 + gap(如果已有内容)
|
|
365
367
|
let xOffset = this.totalWidth > 0 ? this.totalWidth + GAP : 0;
|
|
366
368
|
pageData.forEach((alarm) => {
|
|
367
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
369
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
368
370
|
const contentParts = [];
|
|
369
371
|
if (((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.showTriggerTime) && alarm.triggeredTime) {
|
|
370
372
|
contentParts.push(moment(alarm.triggeredTime).format('YYYY/MM/DD HH:mm:ss'));
|
|
371
373
|
}
|
|
372
|
-
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) ||
|
|
374
|
+
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);
|
|
373
375
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
374
|
-
if (((
|
|
376
|
+
if (((_g = this.model.generalSetting) === null || _g === void 0 ? void 0 : _g.showAlarmLevel) && alarm.alarmLevel !== undefined) {
|
|
375
377
|
const levelMap = isChinese ? ['警告', '次要', '主要', '严重'] : ['Warning', 'Minor', 'Major', 'Critical'];
|
|
376
378
|
contentParts.push(levelMap[alarm.alarmLevel] || (isChinese ? '警告' : 'Warning'));
|
|
377
379
|
}
|
|
378
|
-
if (((
|
|
380
|
+
if (((_h = this.model.generalSetting) === null || _h === void 0 ? void 0 : _h.showAlarmName) && alarm.name) {
|
|
379
381
|
contentParts.push(alarm.name);
|
|
380
382
|
}
|
|
381
|
-
if (((
|
|
383
|
+
if (((_j = this.model.generalSetting) === null || _j === void 0 ? void 0 : _j.showAlarmContent) && alarm.message) {
|
|
382
384
|
contentParts.push(alarm.message);
|
|
383
385
|
}
|
|
384
|
-
if (((
|
|
386
|
+
if (((_k = this.model.generalSetting) === null || _k === void 0 ? void 0 : _k.showAlarmState) && alarm.state !== undefined) {
|
|
385
387
|
const stateMap = isChinese
|
|
386
388
|
? ['触发/未确认', '触发/已确认', '恢复/未确认', '恢复/已确认']
|
|
387
389
|
: ['Triggered/Unconfirmed', 'Triggered/Confirmed', 'Restored/Unconfirmed', 'Restored/Confirmed'];
|
|
@@ -606,7 +608,7 @@ export class ScrollAlarmElement extends ConditionalDynamicDisplayElement {
|
|
|
606
608
|
* 模拟运行时的静态显示逻辑:只显示字段标签,不查询数据
|
|
607
609
|
*/
|
|
608
610
|
renderStaticDisplay() {
|
|
609
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
611
|
+
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;
|
|
610
612
|
// 根据配置构建显示的字段标签
|
|
611
613
|
const textParts = [];
|
|
612
614
|
if (((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.showTriggerTime) !== false) {
|
|
@@ -616,25 +618,25 @@ export class ScrollAlarmElement extends ConditionalDynamicDisplayElement {
|
|
|
616
618
|
}
|
|
617
619
|
if (((_b = this.model.generalSetting) === null || _b === void 0 ? void 0 : _b.showAlarmLevel) !== false) {
|
|
618
620
|
// 获取当前语言环境
|
|
619
|
-
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) ||
|
|
621
|
+
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);
|
|
620
622
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
621
623
|
textParts.push(isChinese ? '严重' : 'Critical');
|
|
622
624
|
}
|
|
623
|
-
if (((
|
|
625
|
+
if (((_h = this.model.generalSetting) === null || _h === void 0 ? void 0 : _h.showAlarmName) === true) {
|
|
624
626
|
// 获取当前语言环境
|
|
625
|
-
const language = ((
|
|
627
|
+
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);
|
|
626
628
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
627
629
|
textParts.push(isChinese ? '室内温度' : 'Indoor Temperature');
|
|
628
630
|
}
|
|
629
|
-
if (((
|
|
631
|
+
if (((_p = this.model.generalSetting) === null || _p === void 0 ? void 0 : _p.showAlarmContent) !== false) {
|
|
630
632
|
// 获取当前语言环境
|
|
631
|
-
const language = ((
|
|
633
|
+
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);
|
|
632
634
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
633
635
|
textParts.push(isChinese ? '室内温度高于30°C或小于10°C' : 'Indoor temperature is higher than 30℃ or lower than 10℃');
|
|
634
636
|
}
|
|
635
|
-
if (((
|
|
637
|
+
if (((_v = this.model.generalSetting) === null || _v === void 0 ? void 0 : _v.showAlarmState) === true) {
|
|
636
638
|
// 获取当前语言环境
|
|
637
|
-
const language = ((
|
|
639
|
+
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);
|
|
638
640
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
639
641
|
textParts.push(isChinese ? '触发/未确认' : 'Triggered/Unconfirmed');
|
|
640
642
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ScrollAlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ScrollAlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-dynamic-display-element","name":"ConditionalDynamicDisplayElement","line":17,"character":40},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":56,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":57,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":58,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":59,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":60,"character":23},{"__symbolic":"reference","module":"../../config","name":"AlarmsStore","line":61,"character":38},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"initDisplayContainer":[{"__symbolic":"method"}],"_buildFontAttrs":[{"__symbolic":"method"}],"_createSvgTextNode":[{"__symbolic":"method"}],"_measureTextWithCanvas":[{"__symbolic":"method"}],"_getSvgTextWidth":[{"__symbolic":"method"}],"_updateUnderlineWidth":[{"__symbolic":"method"}],"renderNewPage":[{"__symbolic":"method"}],"_rebaseTextNodes":[{"__symbolic":"method"}],"removeOldestPage":[{"__symbolic":"method"}],"scrollContent":[{"__symbolic":"method"}],"initScrolling":[{"__symbolic":"method"}],"resetToFirstPage":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}],"renderStaticDisplay":[{"__symbolic":"method"}],"initStaticScrolling":[{"__symbolic":"method"}],"scrollStaticContent":[{"__symbolic":"method"}],"replaceCurrentScrollingContent":[{"__symbolic":"method"}]}}}}]
|