@flexem/fc-gui 3.0.0-alpha.142 → 3.0.0-alpha.143
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 +113 -116
- 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/scroll-alarm/scroll-alarm-element.js +4 -4
- package/elements/shared/text/text-state-element.d.ts +4 -3
- package/elements/shared/text/text-state-element.js +33 -16
- package/elements/static-elements/hyperlink-element.js +22 -29
- package/elements/static-elements/text-element.js +22 -29
- package/elements/view-operation/view-operation.element.d.ts +1 -0
- package/elements/view-operation/view-operation.element.js +32 -38
- package/elements/view-operation/view-operation.element.metadata.json +1 -1
- package/model/shared/text/text.d.ts +3 -0
- package/package.json +1 -1
|
@@ -39173,7 +39173,7 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39173
39173
|
* 否则返回默认文本
|
|
39174
39174
|
*/
|
|
39175
39175
|
getDisplayText() {
|
|
39176
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
39176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39177
39177
|
// 检查是否使用文本库
|
|
39178
39178
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
39179
39179
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -39218,37 +39218,30 @@ class text_element_TextElement extends conditional_dynamic_display_element_Condi
|
|
|
39218
39218
|
return '';
|
|
39219
39219
|
}
|
|
39220
39220
|
// 处理自定义文本(支持多语种)
|
|
39221
|
-
if (this.model.text) {
|
|
39222
|
-
//
|
|
39223
|
-
|
|
39224
|
-
|
|
39225
|
-
|
|
39226
|
-
const
|
|
39227
|
-
// 确定要使用的语种代码(culture)
|
|
39228
|
-
let targetLanguage;
|
|
39229
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
39221
|
+
if (this.model.text || this.model.textCultures) {
|
|
39222
|
+
// 获取目标语种(公共逻辑)
|
|
39223
|
+
const getTargetLanguage = () => {
|
|
39224
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39225
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39226
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39230
39227
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39231
|
-
|
|
39232
|
-
targetLanguage = defaultLanguage;
|
|
39228
|
+
return defaultLanguage;
|
|
39233
39229
|
}
|
|
39234
|
-
|
|
39235
|
-
|
|
39236
|
-
|
|
39237
|
-
|
|
39238
|
-
|
|
39239
|
-
|
|
39240
|
-
|
|
39241
|
-
|
|
39242
|
-
}
|
|
39243
|
-
}
|
|
39244
|
-
// 返回对应语种的文本,如果没有则根据当前语言环境显示默认文本
|
|
39245
|
-
// 获取当前语言环境
|
|
39246
|
-
const language = ((_q = (_p = (_o = window.abp) === null || _o === void 0 ? void 0 : _o.localization) === null || _p === void 0 ? void 0 : _p.currentLanguage) === null || _q === void 0 ? void 0 : _q.name) || 'zh-Hans';
|
|
39247
|
-
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39248
|
-
return this.model.text.cultures[targetLanguage] || (isChinese ? '文本' : 'Text');
|
|
39230
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39231
|
+
};
|
|
39232
|
+
const language = ((_j = (_h = (_g = window.abp) === null || _g === void 0 ? void 0 : _g.localization) === null || _h === void 0 ? void 0 : _h.currentLanguage) === null || _j === void 0 ? void 0 : _j.name) || 'zh-Hans';
|
|
39233
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39234
|
+
const fallback = isChinese ? '文本' : 'Text';
|
|
39235
|
+
// 新格式:textCultures 在顶层(与 text 字段并列)
|
|
39236
|
+
if (this.model.textCultures && typeof this.model.textCultures === 'object') {
|
|
39237
|
+
return this.model.textCultures[getTargetLanguage()] || fallback;
|
|
39249
39238
|
}
|
|
39250
|
-
|
|
39251
|
-
|
|
39239
|
+
// 中间格式(兼容):text 为 { cultures: {...} }
|
|
39240
|
+
if (typeof this.model.text === 'object' && this.model.text.cultures) {
|
|
39241
|
+
return this.model.text.cultures[getTargetLanguage()] || fallback;
|
|
39242
|
+
}
|
|
39243
|
+
// 旧格式:字符串
|
|
39244
|
+
if (typeof this.model.text === 'string') {
|
|
39252
39245
|
return this.model.text;
|
|
39253
39246
|
}
|
|
39254
39247
|
}
|
|
@@ -39301,7 +39294,7 @@ class text_state_element_TextStateElement {
|
|
|
39301
39294
|
return;
|
|
39302
39295
|
}
|
|
39303
39296
|
// 获取显示文本(支持文本库)
|
|
39304
|
-
const content = this.getDisplayText(stateId, textState.text
|
|
39297
|
+
const content = this.getDisplayText(stateId, textState.text);
|
|
39305
39298
|
if (content === '' || content == null) {
|
|
39306
39299
|
this.removeForeignObjectlement();
|
|
39307
39300
|
return;
|
|
@@ -39422,24 +39415,41 @@ class text_state_element_TextStateElement {
|
|
|
39422
39415
|
}
|
|
39423
39416
|
/**
|
|
39424
39417
|
* 获取显示文本
|
|
39425
|
-
*
|
|
39426
|
-
*
|
|
39427
|
-
*
|
|
39418
|
+
* 支持三种格式:
|
|
39419
|
+
* 1. 新格式:textData.cultures 在顶层(与 content 并列)
|
|
39420
|
+
* 2. 中间格式:textData.content 为 { cultures: {...} }(已废弃,向下兼容)
|
|
39421
|
+
* 3. 旧格式:textData.content 为字符串
|
|
39428
39422
|
*/
|
|
39429
|
-
getDisplayText(stateId,
|
|
39430
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
39431
|
-
|
|
39432
|
-
|
|
39423
|
+
getDisplayText(stateId, textData) {
|
|
39424
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
39425
|
+
const getTargetLanguage = () => {
|
|
39426
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39433
39427
|
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
39434
39428
|
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
39435
|
-
let targetLanguage;
|
|
39436
39429
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39437
|
-
|
|
39430
|
+
return defaultLanguage;
|
|
39431
|
+
}
|
|
39432
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
39433
|
+
};
|
|
39434
|
+
const defaultContent = textData === null || textData === void 0 ? void 0 : textData.content;
|
|
39435
|
+
// 新格式:cultures 在 text 顶层
|
|
39436
|
+
if (textData && textData.cultures && typeof textData.cultures === 'object') {
|
|
39437
|
+
const targetLanguage = getTargetLanguage();
|
|
39438
|
+
if (textData.cultures[targetLanguage]) {
|
|
39439
|
+
return textData.cultures[targetLanguage];
|
|
39440
|
+
}
|
|
39441
|
+
else if (this.allowEmpty) {
|
|
39442
|
+
return '';
|
|
39438
39443
|
}
|
|
39439
39444
|
else {
|
|
39440
|
-
const
|
|
39441
|
-
|
|
39445
|
+
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) || 'zh-Hans';
|
|
39446
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39447
|
+
return isChinese ? '文本' : 'Text';
|
|
39442
39448
|
}
|
|
39449
|
+
}
|
|
39450
|
+
// 中间格式(兼容):content 为 { cultures: {...} }
|
|
39451
|
+
if (defaultContent && typeof defaultContent === 'object' && defaultContent.cultures) {
|
|
39452
|
+
const targetLanguage = getTargetLanguage();
|
|
39443
39453
|
if (defaultContent.cultures[targetLanguage]) {
|
|
39444
39454
|
return defaultContent.cultures[targetLanguage];
|
|
39445
39455
|
}
|
|
@@ -39447,7 +39457,7 @@ class text_state_element_TextStateElement {
|
|
|
39447
39457
|
return '';
|
|
39448
39458
|
}
|
|
39449
39459
|
else {
|
|
39450
|
-
const language = ((
|
|
39460
|
+
const language = ((_f = (_e = (_d = window.abp) === null || _d === void 0 ? void 0 : _d.localization) === null || _e === void 0 ? void 0 : _e.currentLanguage) === null || _f === void 0 ? void 0 : _f.name) || 'zh-Hans';
|
|
39451
39461
|
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
39452
39462
|
return isChinese ? '文本' : 'Text';
|
|
39453
39463
|
}
|
|
@@ -39463,17 +39473,17 @@ class text_state_element_TextStateElement {
|
|
|
39463
39473
|
const textEntry = textLibraryData.data.find(entry => entry.value === stateId.toString());
|
|
39464
39474
|
if (textEntry) {
|
|
39465
39475
|
// 获取当前语种ID
|
|
39466
|
-
const currentLanguageId = (
|
|
39476
|
+
const currentLanguageId = (_j = (_h = (_g = this.guiContext) === null || _g === void 0 ? void 0 : _g.getCurrentLanguageId) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : null;
|
|
39467
39477
|
// 确定要使用的语种代码(culture)
|
|
39468
39478
|
let targetLanguage;
|
|
39469
|
-
const defaultLanguage = ((
|
|
39479
|
+
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
39470
39480
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
39471
39481
|
// 设备未设置当前语种,使用默认语种
|
|
39472
39482
|
targetLanguage = defaultLanguage;
|
|
39473
39483
|
}
|
|
39474
39484
|
else {
|
|
39475
39485
|
// 设备已设置当前语种,获取对应的语种代码
|
|
39476
|
-
const currentLanguage = (
|
|
39486
|
+
const currentLanguage = (_m = (_l = this.guiContext) === null || _l === void 0 ? void 0 : _l.getLanguageCultureById) === null || _m === void 0 ? void 0 : _m.call(_l, currentLanguageId);
|
|
39477
39487
|
if (currentLanguage) {
|
|
39478
39488
|
// 直接使用设备设置的语种,不再fallback
|
|
39479
39489
|
targetLanguage = currentLanguage;
|
|
@@ -40509,6 +40519,7 @@ var view_service = __webpack_require__(27);
|
|
|
40509
40519
|
|
|
40510
40520
|
|
|
40511
40521
|
|
|
40522
|
+
|
|
40512
40523
|
class view_operation_element_ViewOperationElement extends conditional_enable_element_ConditionalEnableElement {
|
|
40513
40524
|
constructor(element, injector, modalService, variableCommunicator, variableStore, graphStore, permissionChecker, operationRecordService, securityChecker, localization, popupViewService, hostContainerId, el, signalRAppId, textLibraryService, languageService, guiContext) {
|
|
40514
40525
|
super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
|
|
@@ -40534,12 +40545,11 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40534
40545
|
const height = this.model.size.height;
|
|
40535
40546
|
this.initGraph(width, height);
|
|
40536
40547
|
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', height).attr('fill', 'transparent');
|
|
40537
|
-
//
|
|
40538
|
-
|
|
40539
|
-
const
|
|
40540
|
-
|
|
40541
|
-
|
|
40542
|
-
this.updateTextContent($dateTimeText);
|
|
40548
|
+
// 移除模板中原有的 SVG <text> 元素,改用 TextElementModal(foreignObject)渲染,支持换行
|
|
40549
|
+
this.$element.find('text').last().remove();
|
|
40550
|
+
const font = Object.assign(Object.assign({}, this.model.label.font), { fontFamily: this.model.label.font.fontFamily || 'msyh' });
|
|
40551
|
+
this.textElementModal = new text_element_TextElementModal(this.getDisplayText(), font, width, height);
|
|
40552
|
+
this.$element.append(this.textElementModal.Element);
|
|
40543
40553
|
this.switchToState(0);
|
|
40544
40554
|
this.rootElement.on('mousedown', () => {
|
|
40545
40555
|
if (!this.isInitialized) {
|
|
@@ -40713,24 +40723,23 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40713
40723
|
subscribeLanguageChange() {
|
|
40714
40724
|
if (this.guiContext && this.guiContext.languageChanged$) {
|
|
40715
40725
|
this.languageChangeSubscription = this.guiContext.languageChanged$.subscribe(() => {
|
|
40716
|
-
|
|
40717
|
-
const $dateTimeText = this.$element.find('text').last();
|
|
40718
|
-
this.updateTextContent($dateTimeText);
|
|
40726
|
+
this.updateTextContent();
|
|
40719
40727
|
});
|
|
40720
40728
|
}
|
|
40721
40729
|
}
|
|
40722
40730
|
/**
|
|
40723
40731
|
* 更新文本内容(支持文本库和语种切换)
|
|
40724
40732
|
*/
|
|
40725
|
-
updateTextContent(
|
|
40726
|
-
|
|
40727
|
-
|
|
40733
|
+
updateTextContent() {
|
|
40734
|
+
if (this.textElementModal) {
|
|
40735
|
+
this.textElementModal.updateText(this.getDisplayText());
|
|
40736
|
+
}
|
|
40728
40737
|
}
|
|
40729
40738
|
/**
|
|
40730
40739
|
* 获取显示文本
|
|
40731
40740
|
*/
|
|
40732
40741
|
getDisplayText() {
|
|
40733
|
-
var _a, _b, _c, _d, _e, _f
|
|
40742
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40734
40743
|
// 检查是否使用文本库
|
|
40735
40744
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40736
40745
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -40775,35 +40784,30 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
40775
40784
|
return '';
|
|
40776
40785
|
}
|
|
40777
40786
|
// 处理自定义文本(支持多语种)
|
|
40778
|
-
if (this.model.label
|
|
40779
|
-
//
|
|
40780
|
-
|
|
40781
|
-
|
|
40782
|
-
|
|
40783
|
-
const
|
|
40784
|
-
// 确定要使用的语种代码(culture)
|
|
40785
|
-
let targetLanguage;
|
|
40786
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
40787
|
+
if (this.model.label) {
|
|
40788
|
+
// 获取目标语种(公共逻辑)
|
|
40789
|
+
const getTargetLanguage = () => {
|
|
40790
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40791
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
40792
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
40787
40793
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
40788
|
-
|
|
40789
|
-
targetLanguage = defaultLanguage;
|
|
40794
|
+
return defaultLanguage;
|
|
40790
40795
|
}
|
|
40791
|
-
|
|
40792
|
-
|
|
40793
|
-
|
|
40794
|
-
|
|
40795
|
-
|
|
40796
|
-
|
|
40797
|
-
|
|
40798
|
-
|
|
40799
|
-
|
|
40796
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
40797
|
+
};
|
|
40798
|
+
// 新格式:cultures 在 label 顶层
|
|
40799
|
+
if (this.model.label.cultures && typeof this.model.label.cultures === 'object') {
|
|
40800
|
+
return this.model.label.cultures[getTargetLanguage()] || '';
|
|
40801
|
+
}
|
|
40802
|
+
if (this.model.label.content) {
|
|
40803
|
+
// 中间格式(兼容):content 为 { cultures: {...} }
|
|
40804
|
+
if (typeof this.model.label.content === 'object' && this.model.label.content.cultures) {
|
|
40805
|
+
return this.model.label.content.cultures[getTargetLanguage()] || '';
|
|
40800
40806
|
}
|
|
40801
|
-
// toggle-view 找不到语种内容时默认为空字符串
|
|
40802
|
-
return this.model.label.content.cultures[targetLanguage] || '';
|
|
40803
|
-
}
|
|
40804
|
-
else if (typeof this.model.label.content === 'string') {
|
|
40805
40807
|
// 旧格式:字符串
|
|
40806
|
-
|
|
40808
|
+
if (typeof this.model.label.content === 'string') {
|
|
40809
|
+
return this.model.label.content;
|
|
40810
|
+
}
|
|
40807
40811
|
}
|
|
40808
40812
|
}
|
|
40809
40813
|
return '';
|
|
@@ -40981,7 +40985,7 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
40981
40985
|
* 否则返回默认文本
|
|
40982
40986
|
*/
|
|
40983
40987
|
getDisplayText() {
|
|
40984
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
40988
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40985
40989
|
// 检查是否使用文本库
|
|
40986
40990
|
if (this.model.textLibrary && this.model.textLibrary.labelType === 'textLibrary') {
|
|
40987
40991
|
const textLibraryId = this.model.textLibrary.selectedTextLibraryItem;
|
|
@@ -41026,37 +41030,30 @@ class hyperlink_element_HyperlinkElement extends conditional_dynamic_display_ele
|
|
|
41026
41030
|
return '';
|
|
41027
41031
|
}
|
|
41028
41032
|
// 处理自定义文本(支持多语种)
|
|
41029
|
-
if (this.model.text) {
|
|
41030
|
-
//
|
|
41031
|
-
|
|
41032
|
-
|
|
41033
|
-
|
|
41034
|
-
const
|
|
41035
|
-
// 确定要使用的语种代码(culture)
|
|
41036
|
-
let targetLanguage;
|
|
41037
|
-
const defaultLanguage = ((_k = this.languageService) === null || _k === void 0 ? void 0 : _k.getDefaultLanguage()) || 'zh-CN';
|
|
41033
|
+
if (this.model.text || this.model.textCultures) {
|
|
41034
|
+
// 获取目标语种(公共逻辑)
|
|
41035
|
+
const getTargetLanguage = () => {
|
|
41036
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41037
|
+
const currentLanguageId = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.getCurrentLanguageId) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : null;
|
|
41038
|
+
const defaultLanguage = ((_d = this.languageService) === null || _d === void 0 ? void 0 : _d.getDefaultLanguage()) || 'zh-CN';
|
|
41038
41039
|
if (currentLanguageId === null || currentLanguageId === undefined) {
|
|
41039
|
-
|
|
41040
|
-
targetLanguage = defaultLanguage;
|
|
41040
|
+
return defaultLanguage;
|
|
41041
41041
|
}
|
|
41042
|
-
|
|
41043
|
-
|
|
41044
|
-
|
|
41045
|
-
|
|
41046
|
-
|
|
41047
|
-
|
|
41048
|
-
|
|
41049
|
-
|
|
41050
|
-
}
|
|
41051
|
-
}
|
|
41052
|
-
// 返回对应语种的文本,如果没有则根据当前语言环境显示默认文本
|
|
41053
|
-
// 获取当前语言环境
|
|
41054
|
-
const language = ((_q = (_p = (_o = window.abp) === null || _o === void 0 ? void 0 : _o.localization) === null || _p === void 0 ? void 0 : _p.currentLanguage) === null || _q === void 0 ? void 0 : _q.name) || 'zh-Hans';
|
|
41055
|
-
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
41056
|
-
return this.model.text.cultures[targetLanguage] || (isChinese ? '超链接' : 'Hyperlink');
|
|
41042
|
+
return ((_f = (_e = this.guiContext) === null || _e === void 0 ? void 0 : _e.getLanguageCultureById) === null || _f === void 0 ? void 0 : _f.call(_e, currentLanguageId)) || defaultLanguage;
|
|
41043
|
+
};
|
|
41044
|
+
const language = ((_j = (_h = (_g = window.abp) === null || _g === void 0 ? void 0 : _g.localization) === null || _h === void 0 ? void 0 : _h.currentLanguage) === null || _j === void 0 ? void 0 : _j.name) || 'zh-Hans';
|
|
41045
|
+
const isChinese = language === 'zh-Hans' || language === 'zh';
|
|
41046
|
+
const fallback = isChinese ? '超链接' : 'Hyperlink';
|
|
41047
|
+
// 新格式:textCultures 在顶层(与 text 字段并列)
|
|
41048
|
+
if (this.model.textCultures && typeof this.model.textCultures === 'object') {
|
|
41049
|
+
return this.model.textCultures[getTargetLanguage()] || fallback;
|
|
41057
41050
|
}
|
|
41058
|
-
|
|
41059
|
-
|
|
41051
|
+
// 中间格式(兼容):text 为 { cultures: {...} }
|
|
41052
|
+
if (typeof this.model.text === 'object' && this.model.text.cultures) {
|
|
41053
|
+
return this.model.text.cultures[getTargetLanguage()] || fallback;
|
|
41054
|
+
}
|
|
41055
|
+
// 旧格式:字符串
|
|
41056
|
+
if (typeof this.model.text === 'string') {
|
|
41060
41057
|
return this.model.text;
|
|
41061
41058
|
}
|
|
41062
41059
|
}
|
|
@@ -42532,7 +42529,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
42532
42529
|
this.container = document.createElement('div');
|
|
42533
42530
|
this.container.style.cssText = `
|
|
42534
42531
|
height: ${elementHeight}px;
|
|
42535
|
-
width:
|
|
42532
|
+
width: 100%;
|
|
42536
42533
|
background-color: ${((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.headerFillColor) || '#ffffff'};
|
|
42537
42534
|
display: flex;
|
|
42538
42535
|
align-items: center;
|
|
@@ -42543,11 +42540,11 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
|
|
|
42543
42540
|
`;
|
|
42544
42541
|
this.element.appendChild(this.container);
|
|
42545
42542
|
// 创建一个大容器来包含所有告警项,初始位置在容器右侧(从右边开始滚入)
|
|
42546
|
-
// 使用 position: relative 而非 absolute,避免 iOS Safari foreignObject 内 absolute 定位逃逸到页面左上角的 bug
|
|
42547
42543
|
this.allAlarmsContainer = document.createElement('div');
|
|
42548
42544
|
this.allAlarmsContainer.style.cssText = `
|
|
42549
|
-
position:
|
|
42550
|
-
|
|
42545
|
+
position: absolute;
|
|
42546
|
+
top: 50%;
|
|
42547
|
+
transform: translateY(-50%);
|
|
42551
42548
|
display: flex;
|
|
42552
42549
|
align-items: center;
|
|
42553
42550
|
gap: 80px;
|